fabianonline / telegram_backup

Java app to download all your telegram data.
GNU General Public License v3.0
450 stars 91 forks source link

FLOOD_WAIT exception while downloading media is uncaught, and causes the program to exit #84

Closed leijurv closed 6 years ago

leijurv commented 6 years ago

2018-01-31 12 58 57

While downloading messages normally, FLOOD_WAIT exceptions are caught and followed, however while downloading media a FLOOD_WAIT causes the whole program to exit as the exception remains uncaught.

Rapti commented 6 years ago

This error makes it impossible for me to download a full backup because the program always crashes at the same file.


......................................... ... .............................. ........  ............. - 302700/370702
............................. ................................................................. . .. - 302800/370702
 ......................  ............................... ...................... .................... - 302900/370702
........................... .......... ...................... ..... ................................ - 303000/370702
........... ................................... .. ...........................RpcErrorException happened while downloading /home/leon/.telegram_backup/+49XXXXXXXXXXX/files/stickers/472606317077331981_1772545.webp
420: FLOOD_WAIT_852
        at com.github.badoualy.telegram.api.DefaultTelegramClient.executeRpcQueries(DefaultTelegramClient.kt:209)
        at com.github.badoualy.telegram.api.DefaultTelegramClient.executeRpcQueries$default(DefaultTelegramClient.kt:181)
        at com.github.badoualy.telegram.api.DefaultTelegramClient.executeRpcQueries(DefaultTelegramClient.kt:171)
        at com.github.badoualy.telegram.api.TelegramClient$DefaultImpls.executeRpcQuery(TelegramClient.kt:56)
        at com.github.badoualy.telegram.api.DefaultTelegramClient.executeRpcQuery(DefaultTelegramClient.kt:25)
        at de.fabianonline.telegram_backup.DownloadManager.downloadFileFromDc(DownloadManager.java:398)
        at de.fabianonline.telegram_backup.DownloadManager.downloadFile(DownloadManager.java:365)
        at de.fabianonline.telegram_backup.mediafilemanager.DocumentFileManager.download(DocumentFileManager.java:105)
        at de.fabianonline.telegram_backup.mediafilemanager.StickerFileManager.download(StickerFileManager.java:100)
        at de.fabianonline.telegram_backup.DownloadManager._downloadMedia(DownloadManager.java:341)
        at de.fabianonline.telegram_backup.DownloadManager.downloadMedia(DownloadManager.java:294)
        at de.fabianonline.telegram_backup.CommandLineController.<init>(CommandLineController.java:151)
        at de.fabianonline.telegram_backup.CommandLineRunner.main(CommandLineRunner.java:41)

----- EXIT -----
leijurv commented 6 years ago

For me at least, after many tries (ten or so) I managed to get through every file. One thing that helped was waiting a long time (an hour) before trying again. In your case, telegram is asking you to wait for 852 seconds (FLOOD_WAIT_852) so if you try again before that it will probably fail in the same way.

Rapti commented 6 years ago

I waited over a day once. It always crashes at 30300 files, just like you can see in my log. Even pausing the program with CTRL+Z and resuming much later doesn't change anything.

leijurv commented 6 years ago

@Rapti I have fixed this issue in pull request #87

If / when it's merged, the issue will be fixed in this main repo, until then you could compile and run it yourself from my fork https://github.com/leijurv/telegram_backup

Alternatively, I have compiled my fork into a .jar which is available for download here.