mikf / gallery-dl

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

[Q] [e621] problem '401 Unauthorized' #1593

Closed rod-giovany closed 3 years ago

rod-giovany commented 3 years ago

I can't use username & password, it sends me '401 Unauthorized'.

C:\Users\Jonathan>gallery-dl --verbose https://e621.net/posts?tags=e-01
[gallery-dl][debug] Version 1.17.5
[gallery-dl][debug] Python 3.9.5 - Windows-10-10.0.19043-SP0
[gallery-dl][debug] requests 2.25.1 - urllib3 1.26.4
[gallery-dl][debug] Starting DownloadJob for 'https://e621.net/posts?tags=e-01'
[e621][debug] Using HTTP Basic Auth for user 'mich3218'
[e621][debug] Using E621TagExtractor for 'https://e621.net/posts?tags=e-01'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): e621.net:443
[urllib3.connectionpool][debug] https://e621.net:443 "GET /posts.json?tags=e-01&limit=320 HTTP/1.1" 401 None
[e621][error] HttpError: '401 Unauthorized' for 'https://e621.net/posts.json'

what is the problem?

kattjevfel commented 3 years ago

Can confirm, changed my password so it would at least let me get past the 500 error, and it gives me 401 Unauthorized as well.

[gallery-dl][debug] Version 1.17.5
[gallery-dl][debug] Python 3.9.5 - Linux-5.12.8-zen1-1-zen-x86_64-with-glibc2.33
[gallery-dl][debug] requests 2.25.1 - urllib3 1.26.5

EDIT: bah! Turns out the password must be your API key. Then it works just fine.

mikf commented 3 years ago

Note: The password value for danbooru and e621 should be the API key found in your user profile, not the actual account password.

from https://github.com/mikf/gallery-dl/blob/master/docs/configuration.rst#extractorusername--password

Granted it's easy to miss and the option should probably be called api-key instead of password, but all other sites use username and password for login credentials so I just used the same here.

kattjevfel commented 3 years ago

@mikf I'll admit I just skimmed over https://github.com/mikf/gallery-dl#username--password for this one, lazy as I was :p

rod-giovany commented 3 years ago

How come I did not notice this information of great importance. lol

Note: The password value for danbooru and e621 should be the API key found in your user profile, **not the actual account password**.

@mikf, I think if you should create a special section for danbooru and e621 type; https://github.com/mikf/gallery-dl/blob/master/docs/configuration.rst#extractor-specific-options