Sorrow446 / ZS-DL

CLI Zippyshare downloader written in Python.
26 stars 12 forks source link

Auto retry URL if ZS returns a HTTP 500 error. #3

Closed PaulinoRBJ closed 4 years ago

PaulinoRBJ commented 4 years ago

It has been my experience that Zippyshare throws a HTTP 500 error for roughly 1-5% of all requests at random. zs-dl.py does not currently handle this exception in the best possible way, failing to download files corresponding to these requests with output as below:

URL 27 of 105:
Failed.
HTTPError: 500 Server Error: Internal Server Error for url: https://www15.zippyshare.com/v/xxxx/file.html

My current workaround is passing my links through the script twice: zs-dl.py -u links.txt ; zs-dl.py -u links.txt. Now as you can imagine, while this does give me a very high success rate, it is highly inefficient because the script has to run through every link twice to get to the failed links. I propose that zs-dl.py retry the URL by itself in case ZS returns with a Internal Server Error which should ensure a higher reliability factor with minimal performance impact.

Sorrow446 commented 4 years ago

This is easily done. Thank you for the issue.

EDIT: https://github.com/Sorrow446/ZS-DL/commit/44dff9dad4b5558b4a67da808a0ec2ed4c851026

Also pushed this to the Windows build if needed.

PaulinoRBJ commented 4 years ago

That was very quick. . Obrigado @Sorrow446! 😃