Sometimes when using mangadex-dl it will trigger intermittent download errors where retrying one or more times will result in the download working.
I think it would be better if mangadex-dl would try the download a few times before deciding the download link did not work. I made this small hack which works sometimes, but someone that knows python could probably do better.
diff --git a/mangadex-dl.py b/mangadex-dl.py
index ba98df4..106c70c 100755
--- a/mangadex-dl.py
+++ b/mangadex-dl.py
@@ -133,7 +133,13 @@ def dl(manga_id, lang_code, tld="org"):
with open(outfile, 'wb') as f:
f.write(r.content)
else:
- print("Encountered Error {} when downloading.".format(e.code))
+ time.sleep(5)
+ r = scraper.get(url)
+ if r.status_code == 200:
+ with open(outfile, 'wb') as f:
+ f.write(r.content)
+ else:
+ print("Encountered Error {} when downloading.".format(e.code))
print(" Downloaded page {}.".format(pagenum))
time.sleep(1)
Sometimes when using
mangadex-dl
it will trigger intermittent download errors where retrying one or more times will result in the download working.I think it would be better if
mangadex-dl
would try the download a few times before deciding the download link did not work. I made this small hack which works sometimes, but someone that knows python could probably do better.