mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
10.84k stars 889 forks source link

[kemono] `404 NOT FOUND` for new posts #1903

Closed TestPolygon closed 2 years ago

TestPolygon commented 2 years ago

gallery-dl does not follow redirects, I get for the recently uploaded posts:

[urllib3.connectionpool][debug] Starting new HTTPS connection (3): kemono.party:443
[urllib3.connectionpool][debug] https://kemono.party:443 "GET /6d/cc/6dcc1c5f2abd4234e5512d0ea3cf21eb8b1eb4df54ba069cf6d613d8ac43ee2d.png HTTP/1.1" 404 None
[downloader.http][warning] '404 NOT FOUND' for 'https://kemono.party/6d/cc/6dcc1c5f2abd4234e5512d0ea3cf21eb8b1eb4df54ba069cf6d613d8ac43ee2d.png'

While in the browser https://kemono.party/data/6d/cc/6dcc1c5f2abd4234e5512d0ea3cf21eb8b1eb4df54ba069cf6d613d8ac43ee2d.png correctly redirects to the new address https://data1.kemono.party/data/6d/cc/6dcc1c5f2abd4234e5512d0ea3cf21eb8b1eb4df54ba069cf6d613d8ac43ee2d.png

kattjevfel commented 2 years ago

Please try https://github.com/mikf/gallery-dl/pull/1902 and see if it fixes your issue.

TestPolygon commented 2 years ago

I did not try, but yeah, gallery-dl have missed /data in the url. Because of this gallery-dl does not follow redirect, since the initial url is wrong.


Hm, why he does it so.

url = self.root + '/data' + url.replace(self.root, '')

Why not just:

+ url = self.root + '/data' + url
- url = self.root + url
TestPolygon commented 2 years ago

I'm lazy to check it locally, but visually his commit should not work. May be I'm wrong, but I don't see url in the global scope. He deleted the url variable, but then he uses it. Also he uses the strange assignment to url (as I have noted it above)

Also will it work for old urls?


His commit should work only if there is url in the global scope with the full url value.

mikf commented 2 years ago

Should work again for newer posts, but I'm getting all sorts of timeout errors for older ones depending on which data server kemono redirects to.

[downloader.http][warning] HTTPSConnectionPool(host='data3.kemono.party', port=443): Read timed out. (read timeout=30.0) (1/5)
Diadial commented 2 years ago

Should work again for newer posts, but I'm getting all sorts of timeout errors for older ones depending on which data server kemono redirects to.

[downloader.http][warning] HTTPSConnectionPool(host='data3.kemono.party', port=443): Read timed out. (read timeout=30.0) (1/5)

Hello Mikf. Is this issue retrieving older posts something we can expect some kind of guide or work-around on in the future? Or is this a structural issue with Kemono.party data servers that will not be able to solved?

Thanks.

mikf commented 2 years ago

@Diadial it was a structural issue with kemono's data servers, but it seems to be gone now.

Diadial commented 2 years ago

@Diadial it was a structural issue with kemono's data servers, but it seems to be gone now.

Ah apologies. I had to update pip & gallery-dl. Is working correctly now.