mikf / gallery-dl

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

[coomerparty][error] HttpError: '401 UNAUTHORIZED' for 'https://coomer.party/api/favorites?type=artist' #3884

Closed Kyle-Mickan closed 3 months ago

Kyle-Mickan commented 1 year ago

When trying to download favorites for coomerparty I get this error:

gallery-dl -v https://coomer.party/favorites
[gallery-dl][debug] Version 1.24.0
[gallery-dl][debug] Python 3.10.5 - macOS-12.6.3-x86_64-i386-64bit
[gallery-dl][debug] requests 2.28.1 - urllib3 1.26.12
[gallery-dl][debug] Configuration Files ['${HOME}/.config/gallery-dl/config.json']
[gallery-dl][debug] Starting DownloadJob for 'https://coomer.party/favorites'
[coomerparty][debug] Using KemonopartyFavoriteExtractor for 'https://coomer.party/favorites'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): coomer.party:443
[urllib3.connectionpool][debug] https://coomer.party:443 "GET /api/favorites?type=artist HTTP/1.1" 401 0
[coomerparty][error] HttpError: '401 UNAUTHORIZED' for 'https://coomer.party/api/favorites?type=artist'

Favorites for kemono.party works fine. I do have different usernames and passwords for both kemono and coomer these are both in the config. I also have no trouble downloading individual creators just my favorites.

Even going to https://coomer.party/api/favorites?type=artist myself brings up the correct JSON file of my favorites, could there potentially be a login issue given its a 401 error? My config is as follows under the extractor key.

    "extractor": {
        ...
        "kemonoparty": {
            "username": "<UsernameA>",
            "password": "<PasswordA>"
        },
        "coomerparty": {
            "username": "<UsernameB>",
            "password": "<PasswordB>"
        }
        ...
},
phauxcamus commented 3 months ago

I seem to be running into this issue as well but for Kemono instead of Coomer, and I'm using the -u and -p parameters instead of a config file, so I suspect this isn't a config issue nor exclusive to one or the other site.

I thought it could've been the password I had since it was >24 characters with symbols (I've ran into APIs in the past that don't like super complex passwords), but changing it to something simplier did not help. I have a different login for Coomer with a similar complex password and it works fine.

mikf commented 3 months ago

Try running gallery-dl --clear-cache kemonoparty to get rid of potentially expired session cookies and force a re-login the next time you try to download your favorites. Providing cookies instead of username & password should help as well.

I've ran into APIs in the past that don't like super complex passwords

The login procedure for kemono uses the HTML login form. I don't think the kemono API even provides any login functionality.

Kyle-Mickan commented 3 months ago

I did have issues with that in the past they seem to have been resolved in an update. I am not sure which specific update, it just worked one day. Updating is the only thing I can suggest to get yours working @phauxcamus.

phauxcamus commented 3 months ago

Try running gallery-dl --clear-cache kemonoparty to get rid of potentially expired session cookies and force a re-login the next time you try to download your favorites. Providing cookies instead of username & password should help as well.

Yeah, I had discovered this was the issue earlier today. I'll try using cookies instead, seeing as the cookies are set to expire in 10 years 😉