9-FS / nhentai_archivist

downloads hentai from nhentai.net and converts to CBZ
MIT License
92 stars 4 forks source link

[Enhancement] Allow override image domain or cycle to alternate urls when hit 404 #2

Closed shinji257 closed 1 week ago

shinji257 commented 1 week ago

Currently this appears to try multiple times when a 404 is hit however it keeps trying i.nhentai.net which may result in the same thing. If I'm right I think it is a round robin but rather than retrying that I might suggest instead rotating between i2, i3, i5, and i7 which appears to be the more direct servers. These seem to be chosen at random on the website and for some items it seems that they throw a 404 on some servers but not others.

Suggestion is to either automatically cycle on a 404 to try and get to a server where the file exists or allow the user to redefine the domain part of the url so that we may attempt to workaround the issue ourselves.

shinji257 commented 1 week ago

Actually I think the 404 here is the same as the api 404. I've modified my version of the code to add delays when an error is hit assuming it is throttling on the server side.

9-FS commented 1 week ago

To clarify: Are you talking about error 404 during metadata download or during image download?

shinji257 commented 1 week ago

This one was for image downloads. The other one was for metadata and may be different. I don't know if thye have different solutions or is even something that can be handled.

9-FS commented 1 week ago

Suggestion is to either automatically cycle on a 404 to try and get to a server where the file exists

I agree, I'll do that.

9-FS commented 1 week ago

merged into dev

shinji257 commented 2 days ago

I know that you have had this in for a few days now. I grabbed the update after you committed it and just got the new update as well today. It has worked perfectly and so far the only 404s that I have gotten are ones that were actually removed after it built the downloadme.txt file.