Asynchronous fork of FastTelethonhelper
Provides fully async and parallel file upload/download functions using aiofiles and non-blocking I/O.
pip install aiofasttelethonhelperfrom aiofasttelethonhelper.utils import print_progress_bar
from aiofasttelethonhelper import fast_download, fast_upload
from telethon import TelegramClient
client = TelegramClient("session", API_ID, API_HASH)
def custom_progress_callback(**kwargs):
done, total = kwargs.get('done'), kwargs.get('total')
print(f"{done}/{total}")
async def main():
async with client:
file_path = await fast_download(
client=client,
message=message,
file_path="./downloads", # or ./downloads/file.txt
progress_callback=print_progress_bar
)
file = await fast_upload(
client=client,
file_path="input.txt",
progress_callback=custom_progress_callback
)
await client.send_file("me", file)- Tulir Asokan - Original parallel transfer logic in mautrix-telegram
- MiyukiKun - Original helper creator
- Lonami - Creator of the amazing Telethon library