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 download_with_progressbar
- When you need to download file,
downloaded_location = await download_with_progressbar(client, reply, message)
- The function returns the download location.
reply
is the message object you want the progress bar to be displayed onmessage
is the message object that contains the file you need to download.- There is a similar function without progressbar where you dont need to give
reply
object, rest is same
Uploads:
- Usage
from FastTelethonhelper import upload_with_progressbar
- When you need to upload file,
await upload_with_progressbar(client, reply, file_location, name, thumbnail)
- This function returns the message object(the one in which file was sent)
reply
is the message object you want the progress bar to be displayed onfile_location
is where the file is located that you want to uploadname
(optional) if you want to change the name of file you are uploading, leave as None if you dont want to change it.thumbnail
(optional) the thumbnail of the file you want to display when sending the file- Note* the file will be sent in same chat as the progressbar display message.
- There is a similar function without progressbar where you need to give
entity
of chat you want to send file to instead ofreply
object, rest is same
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
Close
Hashes for FastTelethonhelper-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7ccb4b21b8219e198c3b2f7a9fd4bf64f118b40e3230a9326175716ac2eb675 |
|
MD5 | 5a9a8989315f6b2e32ee087af59e803b |
|
BLAKE2b-256 | d21b91cb56da885a2f07cf004f856fd197a3c8703348f2089f0c042dea3ce486 |