Hello,
I'm encountering an issue while trying to use gallery-dl to download images from Reddit. Initially, everything worked fine when I didn't specify the use of the "reddit:" extractor. However, this led to frequent API limit restrictions. To circumvent this issue, I attempted to add my custom API credentials to the config file to avoid the API limit.
When I ran the command gallery-dl oauth:reddit, it consistently used a default Reddit client ID. To force it to use the config file with my custom client ID, I specified the config file path in the command, which made it work as intended (command: gallery-dl --config C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\gallery_dl/config.json oauth:reddit). My web browser opened, and I successfully accepted the connection with my Reddit account. However, upon clicking "accept," I received the following error on the webpage (I've omitted any usernames and client-ids):
Remote server reported an error:
{'message': 'Unauthorized', 'error': 401}
In my command prompt, I also received the following error:
C:\Users\User\Pictures\Good` Stuff>gallery-dl --config C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\gallery_dl/config.json oauth:reddit
[oauth][info] Using custom reddit client ID (Ni2************)
[oauth][info] Opening URL in :
https://www.reddit.com/api/v1/authorize?client_id=Ni2**********&response_type=code&state=gallery-dl_reddit_******&redirect_uri=http%3A%2F%2Flocalhost%3A6414%2F&duration=permanent&scope=read+history
Waiting for response. (Cancel with Ctrl+c)
Remote server reported an error:
{'message': 'Unauthorized', 'error': `401}
Even though I got the 401 error and never received a refresh token, when I went to https://www.reddit.com/prefs/apps, it showed my specified application as an "authorized app." Despite this, even when attempting to download images from a random user's profile and specifying the config file, I continued to receive the 401 error
C:\Users\User\Pictures\Good Stuff>gallery-dl -v --config C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\gallery_dl/config.json https://www.reddit.com/user/{reddit_username}/
[gallery-dl][debug] Version 1.26.0
[gallery-dl][debug] Python 3.12.0 - Windows-10-10.0.19045-SP0
[gallery-dl][debug] requests 2.31.0 - urllib3 2.0.6
[gallery-dl][debug] Configuration Files ['C:\\Users\\User\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\gallery_dl/config.json']
[gallery-dl][debug] Starting DownloadJob for 'https://www.reddit.com/user/{reddit_username}/'
[reddit][debug] Using RedditUserExtractor for 'https://www.reddit.com/user/{reddit_username}/'
[reddit][debug] Using custom API credentials (client-id Ni2i6*****************)
[reddit][info] Requesting public access token
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.reddit.com:443
[urllib3.connectionpool][debug] https://www.reddit.com:443 "POST /api/v1/access_token HTTP/1.1" 401 41
[reddit][debug] Server response: {'message': 'Unauthorized', 'error': 401}
[reddit][error] AuthenticationError: "401: Unauthorized"
I've attempted this process with two separate Reddit API apps, but I encountered the same issue both times. I've also restarted my computer multiple times and cleared gallery-dl's Reddit cache, all without success. Any assistance would be greatly appreciated.
Here is my config.json file if that helps:
{
"extractor":
{
"reddit":
{
"client-id": "Ni2**************",
"client-secret": "Dl********************",
"user-agent": "Python:rbd:v1.0 (by /u/{my_reddit_account)",
}
}
}
Hello,
I'm encountering an issue while trying to use gallery-dl to download images from Reddit. Initially, everything worked fine when I didn't specify the use of the "reddit:" extractor. However, this led to frequent API limit restrictions. To circumvent this issue, I attempted to add my custom API credentials to the config file to avoid the API limit.
When I ran the command
gallery-dl oauth:reddit, it consistently used a default Reddit client ID. To force it to use the config file with my custom client ID, I specified the config file path in the command, which made it work as intended (command:gallery-dl --config C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\gallery_dl/config.json oauth:reddit). My web browser opened, and I successfully accepted the connection with my Reddit account. However, upon clicking "accept," I received the following error on the webpage (I've omitted any usernames and client-ids):In my command prompt, I also received the following error:
Even though I got the 401 error and never received a refresh token, when I went to https://www.reddit.com/prefs/apps, it showed my specified application as an "authorized app." Despite this, even when attempting to download images from a random user's profile and specifying the config file, I continued to receive the 401 error
I've attempted this process with two separate Reddit API apps, but I encountered the same issue both times. I've also restarted my computer multiple times and cleared gallery-dl's Reddit cache, all without success. Any assistance would be greatly appreciated.
Here is my config.json file if that helps: