Gallery-dl: deviantart oauth issue

Created on 24 Apr 2019  路  5Comments  路  Source: mikf/gallery-dl

Hey. I've authenticated with deviantart using oauth before, but no matter what I do I keep getting this message.

I can get as far as the deviantart page where it lets you authenticate and check the box that says "I understand that gallery-dl will now act in the manner described above."

But then it redirects to here: http://localhost:6414/?code=7452961a6b6478d1fe900fa7abec4e06e9347af9&state=gallery-dl_deviantart_ovFPkoNX

And it goes to a local server like that every time I try afterwards.

V:>gallery-dl oauth:deviantart --verbose
[gallery-dl][debug] Version 1.8.2
[gallery-dl][debug] Python 3.4.4 - Windows-10-10.0.17763
[gallery-dl][debug] requests 2.21.0 - urllib3 1.24.1
[gallery-dl][debug] Starting DownloadJob for 'oauth:deviantart'
[oauth][debug] Using OAuthDeviantart for 'oauth:deviantart'
Waiting for response. (Cancel with Ctrl+c)
[oauth][error] Unable to download data: OSError: Could not find a suitable TLS CA certificate bundle, invalid path: V:\gallery-dl.exe\certifi\cacert.pem
[oauth][debug]
Traceback (most recent call last):
File "E:\gallery-dl\gallery_dl\job.py", line 54, in run
File "E:\gallery-dl\gallery_dl\extractor\oauth.py", line 178, in items
File "E:\gallery-dl\gallery_dl\extractor\oauth.py", line 142, in _oauth2_authorization_code_grant
File "C:\Python34\lib\site-packages\requests\sessions.py", line 581, in post
File "C:\Python34\lib\site-packages\requests\sessions.py", line 533, in request
File "C:\Python34\lib\site-packages\requests\sessions.py", line 646, in send
File "C:\Python34\lib\site-packages\requests\adapters.py", line 416, in send
File "C:\Python34\lib\site-packages\requests\adapters.py", line 228, in cert_verify
OSError: Could not find a suitable TLS CA certificate bundle, invalid path: V:\gallery-dl.exe\certifi\cacert.pem

How would I fix this issue with cacert?

This is on a Windows 10 x64 machine using v1.82 via the prebuilt binary.

The non-verbose one outputs this upon trying to download from deviantart:

[deviantart][info] Refreshing private access token
[deviantart][error] HTTP request failed: 400: Bad Request for url: https://www.deviantart.com/oauth2/token

bug

All 5 comments

The current executable doesn't include a CA certificate bundle (not possible with py2exe as far as I can tell) and therefore globally disabled certificate checks ... until 4ca4631b (version 1.8.0 and up). This change works fine for normal HTTP connections, but apparently not when doing OAuth authentication.

Starting with version 1.8.3 standalone executables will be build with PyInstaller and include a certificate bundle, which will fix this error.

But then it redirects to here: http://localhost:6414/?code=7452961a6b6478d1fe900fa7abec4e06e9347af9&state=gallery-dl_deviantart_ovFPkoNX

And it goes to a local server like that every time I try afterwards.

That's how it is supposed to work. gallery-dl needs to somehow receive data from a remote server and listening on a local port is easiest way of doing so. The other option would be to ask the user to copy&paste some text from their web browser to the terminal window, but that's just unnecessarily tedious.

A possible solution that should work right now:

  • use the v1.7.0 executable to get your refresh-token with oauth:deviantart
  • put it into your config file
  • and use gallery-dl v1.8.2 to download

That worked! Thank you so much for the prompt reply.

I love this app. It does its' job very very very well.

I love this app. It does its' job very very very well.

Yeah, it really does.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ucok66 picture ucok66  路  6Comments

colpocleisis picture colpocleisis  路  3Comments

Mrakobes666 picture Mrakobes666  路  6Comments

ucok66 picture ucok66  路  3Comments

OvertPerson picture OvertPerson  路  5Comments