Make Telethon files upload/download faster
Project description
FastTelethon helper
- Make use of FastTelethon to upload and download files
Usage:
Installation:
pip install FastTelethonhelper
Downloads:
- Usage
from FastTelethonhelper import fast_download - When you need to download file,
downloaded_location = await fast_download(client, msg, reply, download_folder, progress_bar_function)client= Telegram Client(Required)msg= The message object which has the file to be downloaded(Required)reply= The message on which you want the progressbar(Optional)download_folder= Location where you want file to be downloaded, defaults to ./downloads/ (Optional)progress_bar_function= The function you want to use to display the string in progressbar, it needs to have 2 parameters done bytes and total bytes and must return a desired string, defaults to a function I wrote(Optional)
- The function returns the download location.
Uploads:
- Usage
from FastTelethonhelper import fast_upload - When you need to upload file,
await fast_upload(client, file_location, reply, name, progress_bar_function)client= TelegramClient(Required)file_location= Where the file is located(Required)reply= The message object you want the progressbar to appear(Optional)name= Name of the file you want while uploading(Optional)progress_bar_function= The function you want to use to display the string in progressbar, it needs to have 2 parameters done bytes and total bytes and must return a desired string, defaults to a function I wrote(Optional)
- This function returns the file object which you can use in send_message in telethon example
await bot.send_message(file=<what this function returns>)
Credits
- MiyukiKun for getting this together
- Loonami for telethon
- Tulir Asokan for mautrix-telegram
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file FastTelethonhelper-1.0.7.tar.gz.
File metadata
- Download URL: FastTelethonhelper-1.0.7.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ca0d4fb50c5edb27964ce73e849b9ae8839b3abe4222716ffae2933e7949f44
|
|
| MD5 |
c91e2b0048ba0501d53a750ec1d22851
|
|
| BLAKE2b-256 |
2d878d300152a005bfdd02ffc8dccd0d08d95a79c58e941b188263aacb269717
|
File details
Details for the file FastTelethonhelper-1.0.7-py3-none-any.whl.
File metadata
- Download URL: FastTelethonhelper-1.0.7-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
539359394b5c9dd288d37aa12550fd6ff35020a9158851ff3f3d922733fe86f7
|
|
| MD5 |
5d755d5b30a65600d89714c656092dc6
|
|
| BLAKE2b-256 |
04260362aa8ee3528159f2e05e0bf8274ea7ddb8060c7ca7f08b66522c086fff
|