Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imgur NSFW content #446

Closed
rEnr3n opened this issue Oct 15, 2019 · 5 comments
Closed

Imgur NSFW content #446

rEnr3n opened this issue Oct 15, 2019 · 5 comments

Comments

@rEnr3n
Copy link

rEnr3n commented Oct 15, 2019

https://blog.imgur.com/2019/10/14/discontinuing-support-for-nsfw-reddit-subsections/

I provided my username and password in my config but it still won't work.

$ gallery-dl --verbose https://i.imgur.com/d2ZQcWY.jpg
[gallery-dl][debug] Version 1.10.6
[gallery-dl][debug] Python 3.7.4 - Linux-5.3.5-arch1-1-ARCH-x86_64-with-arch
[gallery-dl][debug] requests 2.22.0 - urllib3 1.25.5
[gallery-dl][debug] Starting DownloadJob for 'https://i.imgur.com/d2ZQcWY.jpg'
[gallery-dl][debug] Updating urllib3 ciphers
[imgur][debug] Using ImgurImageExtractor for 'https://i.imgur.com/d2ZQcWY.jpg'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): imgur.com:443
[urllib3.connectionpool][debug] https://imgur.com:443 "GET /d2ZQcWY HTTP/1.1" 200 23396
[imgur][error] An unexpected error occurred: TypeError - the JSON object must be str, bytes or bytearray, not NoneType. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[imgur][debug]
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/gallery_dl/job.py", line 47, in run
    for msg in self.extractor:
  File "/usr/lib/python3.7/site-packages/gallery_dl/extractor/imgur.py", line 132, in items
    image = self._extract_data("/" + self.key)
  File "/usr/lib/python3.7/site-packages/gallery_dl/extractor/imgur.py", line 34, in _extract_data
    response.text, "image               : ", ",\n")[0])
  File "/usr/lib/python3.7/json/__init__.py", line 341, in loads
    raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
$ gallery-dl --verbose https://imgur.com/a/qebnXYI
[gallery-dl][debug] Version 1.10.6
[gallery-dl][debug] Python 3.7.4 - Linux-5.3.5-arch1-1-ARCH-x86_64-with-arch
[gallery-dl][debug] requests 2.22.0 - urllib3 1.25.5
[gallery-dl][debug] Starting DownloadJob for 'https://imgur.com/a/qebnXYI'
[gallery-dl][debug] Updating urllib3 ciphers
[imgur][debug] Using ImgurAlbumExtractor for 'https://imgur.com/a/qebnXYI'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): imgur.com:443
[urllib3.connectionpool][debug] https://imgur.com:443 "GET /a/qebnXYI/all HTTP/1.1" 200 23432
[imgur][error] An unexpected error occurred: TypeError - the JSON object must be str, bytes or bytearray, not NoneType. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[imgur][debug]
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/gallery_dl/job.py", line 47, in run
    for msg in self.extractor:
  File "/usr/lib/python3.7/site-packages/gallery_dl/extractor/imgur.py", line 193, in items
    album = self._extract_data("/a/" + self.key + "/all")
  File "/usr/lib/python3.7/site-packages/gallery_dl/extractor/imgur.py", line 34, in _extract_data
    response.text, "image               : ", ",\n")[0])
  File "/usr/lib/python3.7/json/__init__.py", line 341, in loads
    raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
@mikf
Copy link
Owner

mikf commented Oct 16, 2019

Login support with username & password has been implemented, as well as friendlier and more informative error messages when no JSON data could be found.

If you can't login because imgur wants you to enter a captcha, it is always possible to login with your browser, export imgur's cookies, and use those with gallery-dl.

@mikf mikf closed this as completed Oct 16, 2019
mikf added a commit that referenced this issue Oct 23, 2019
Using the API endpoints makes it possible to access NSFW content
without logging in.
@mikf
Copy link
Owner

mikf commented Oct 23, 2019

gallery-dl is now using Imgur's API to get image and album information, which doesn't need any authentication for NSFW content or otherwise.

@github-userx
Copy link

github-userx commented Oct 23, 2019 via email

@mikf
Copy link
Owner

mikf commented Oct 23, 2019

That's not my own API key, it's Imgur's "public" key embedded into every Imgur page. Go to, for example, https://imgur.com/21yMxCS, look at its HTML source, and search for "apiClientId".

@github-userx
Copy link

github-userx commented Oct 23, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants