1

I use the pyrogram python library often. I encounter the following error very frequently, and haven't found a way to solve it. It comes seemingly randomly, which is odd considering that I am not being rate limited by the Telegram servers. The following message is the error that I encounter randomly:

pyrogram.errors.rpc_error.UnknownError: [520 Unknown error]: [-503 Timeout] (caused by "upload.GetFile")

Has anyone ever faced this error themselves, and how have you managed to fix it? What are its causes, if not rate-limiting?

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Francesco
  • 21
  • 3

1 Answers1

0

According to this issue on the pyrogram GitHub repository, if this issue happens a lot then it is a server issue. However, it is mishandled by pyrogram. If it keeps happening for you, then consider using a different endpoint/method to achieve what you are trying to do, as this is a server-side problem and will arise, no matter which module you use.

The best nugget of information I managed to find from that thread was from this answer, which recommends that you use the following method instead:

path = client.download_media(m.photo, file_name="test1.jpg", block=False)
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Xiddoc
  • 3,369
  • 3
  • 11
  • 37