LonamiWebs / Telethon

Pure Python 3 MTProto API Telegram client library, for bots too!

Home Page:https://docs.telethon.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Files are so slow to download that File_Reference is running out of time

FreeM1ne opened this issue · comments

Code that causes the issue

telethon.errors.rpcerrorlist.FileReferenceExpiredError: The file reference has expired and is no longer valid or it belongs to self-destructing media and cannot be resent (caused by GetFileRequest

Expected behavior

telethon.errors.rpcerrorlist.FileReferenceExpiredError: The file reference has expired and is no longer valid or it belongs to self-destructing media and cannot be resent (caused by GetFileRequest

Actual behavior

telethon.errors.rpcerrorlist.FileReferenceExpiredError: The file reference has expired and is no longer valid or it belongs to self-destructing media and cannot be resent (caused by GetFileRequest

Traceback

telethon.errors.rpcerrorlist.FileReferenceExpiredError: The file reference has expired and is no longer valid or it belongs to self-destructing media and cannot be resent (caused by GetFileRequest

Telethon version

last

Python version

3.11.5

Operating system (including distribution name and version)

Windows 10

Other details

No response

Checklist

  • The error is in the library's code, and not in my own.
  • I have searched for this issue before posting it and there isn't an open duplicate.
  • I ran pip install -U https://github.com/LonamiWebs/Telethon/archive/v1.zip and triggered the bug in the latest version.

download speed does not exceed 0.3mb

I think we should add a "workers" parameter to specify the number of workers to download the file.

I don't have plans to complicate the download code further. Not in v1.

However, the above should refetch the message, if you're using message.download_media to download the file.

Yeah, I'm using message.download_media
but the error still appears

The above commit has not been released yet, though you could try pip3 install -U https://github.com/LonamiWebs/Telethon/archive/v1.zip and see if it helped at all.

Either way it's very slow, also, on importance I rate it 8/10
Telegram wouldn't be telegram if it didn't have files, it's not just chatting.