mikf / gallery-dl

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

[tumblr][error] An unexpected error occurred: JSONDecodeError #297

Closed ghost closed 5 years ago

ghost commented 5 years ago

warning: NSFW link

C:\Users\ucok66>gallery-dl http://ziemniax.tumblr.com/post/109697912859/black-spear-presenting-herself-in-full-glory
[tumblr][error] An unexpected error occurred: JSONDecodeError - Expecting value: line 1 column 1 (char 0). Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .

C:\Users\ucok66>gallery-dl --verbose flag http://ziemniax.tumblr.com/post/109697912859/black-spear-presenting-herself-in-full-glory
[gallery-dl][debug] Version 1.8.5
[gallery-dl][debug] Python 3.7.3 - Windows-10-10.0.17763-SP0
[gallery-dl][debug] requests 2.21.0 - urllib3 1.24
[1/2] flag
[gallery-dl][debug] Starting DownloadJob for 'flag'
[gallery-dl][debug] updating default urllib3 ciphers
[gallery-dl][error] No suitable extractor found for 'flag'
[2/2] http://ziemniax.tumblr.com/post/109697912859/black-spear-presenting-herself-in-full-glory
[gallery-dl][debug] Starting DownloadJob for 'http://ziemniax.tumblr.com/post/109697912859/black-spear-presenting-herself-in-full-glory'
[tumblr][debug] Using api_key authentication
[tumblr][debug] Using TumblrPostExtractor for 'http://ziemniax.tumblr.com/post/109697912859/black-spear-presenting-herself-in-full-glory'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): api.tumblr.com:443
[urllib3.connectionpool][debug] https://api.tumblr.com:443 "GET /v2/blog/ziemniax.tumblr.com/posts?id=109697912859&offset=0&limit=50&reblog_info=true&api_key=O3hU2tMi5e4Qs5t3vezEi6L0qRORJ5y9oUpSGsrWu8iA3UCc3B HTTP/1.1" 404 1278
[tumblr][error] An unexpected error occurred: JSONDecodeError - Expecting value: line 1 column 1 (char 0). Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[tumblr][debug]
Traceback (most recent call last):
  File "c:\users\ucok66\appdata\local\programs\python\python37\lib\site-packages\gallery_dl\job.py", line 53, in run
    for msg in self.extractor:
  File "c:\users\ucok66\appdata\local\programs\python\python37\lib\site-packages\gallery_dl\extractor\tumblr.py", line 72, in items
    for post in self.posts():
  File "c:\users\ucok66\appdata\local\programs\python\python37\lib\site-packages\gallery_dl\extractor\tumblr.py", line 351, in posts
    data = self._call(blog, "posts", params)
  File "c:\users\ucok66\appdata\local\programs\python\python37\lib\site-packages\gallery_dl\extractor\tumblr.py", line 375, in _call
    data = response.json()
  File "c:\users\ucok66\appdata\local\programs\python\python37\lib\site-packages\requests\models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "c:\users\ucok66\appdata\local\programs\python\python37\lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "c:\users\ucok66\appdata\local\programs\python\python37\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "c:\users\ucok66\appdata\local\programs\python\python37\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
mikf commented 5 years ago

Tumblr's API returns a There's nothing here. HTML page for this particular post, instead of the expected JSON response. Should be fixed with https://github.com/mikf/gallery-dl/commit/208202b9620925a92d806b3bb53dbff451ae001f.

Can you actually view this post in your browser? Because I can't (with my account) and it is also not listed under http://ziemniax.tumblr.com.

Another thing I found while looking into this: You get to download quite a few more files for http://ziemniax.tumblr.com when using OAuth instead of the default API key authentication.

ghost commented 5 years ago

Can you actually view this post in your browser?

No, I can't.

it is also not listed under http://ziemniax.tumblr.com.

It should be, but I think it's been censored

Sigh, In the past, this downloader was able to download this post, but now it can't. Tumblr becomes worse

Hrxn commented 5 years ago

Yeah, Tumblr is a broken mess after the "purge".