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

[Flickr] JSONDecodeError #5131

Closed
patrikalienus opened this issue Jan 29, 2024 · 7 comments
Closed

[Flickr] JSONDecodeError #5131

patrikalienus opened this issue Jan 29, 2024 · 7 comments

Comments

@patrikalienus
Copy link

patrikalienus commented Jan 29, 2024

Since yesterday, downloading anything from flickr does not work.

$ gallery-dl https://flickr.com/photos/71875615@N07/albums/72177720308827962/
[flickr][error] Unable to download data:  JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I'm using gallery-dl 1.26.7

Here's the same command with --verbose defined.

$ gallery-dl https://flickr.com/photos/71875615@N07/albums/72177720308827962/ --verbose
[gallery-dl][debug] Version 1.26.7
[gallery-dl][debug] Python 3.12.1 - macOS-12.6.5-x86_64-i386-64bit
[gallery-dl][debug] requests 2.31.0 - urllib3 2.1.0
[gallery-dl][debug] Configuration Files ['${HOME}/.config/gallery-dl/config.json']
[gallery-dl][debug] Starting DownloadJob for 'https://flickr.com/photos/71875615@N07/albums/72177720308827962/'
[flickr][debug] Using FlickrAlbumExtractor for 'https://flickr.com/photos/71875615@N07/albums/72177720308827962/'
[flickr][debug] Using default OAuth1.0 authentication
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): api.flickr.com:443
[urllib3.connectionpool][debug] https://api.flickr.com:443 "GET /services/rest/?url=https%3A%2F%2Fwww.flickr.com%2Fphotos%2F71875615%40N07&method=flickr.urls.lookupUser&format=json&nojsoncallback=1 HTTP/1.1" 429 117
[flickr][error] Unable to download data:  JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[flickr][debug]
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/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)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/gallery_dl/job.py", line 127, in run
    for msg in extractor:
  File "/usr/local/lib/python3.12/site-packages/gallery_dl/extractor/flickr.py", line 36, in items
    data = self.metadata()
           ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/gallery_dl/extractor/flickr.py", line 135, in metadata
    data = FlickrExtractor.metadata(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/gallery_dl/extractor/flickr.py", line 53, in metadata
    self.user = self.api.urls_lookupUser(self.item_id)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/gallery_dl/extractor/flickr.py", line 367, in urls_lookupUser
    user = self._call("urls.lookupUser", params)["user"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/gallery_dl/extractor/flickr.py", line 389, in _call
    data = self.request(self.API_URL, params=params).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
@clouds321
Copy link

same, but not only albums, anything on flickr

I ran brew upgrade to see if helps but no

@patrikalienus
Copy link
Author

same, but not only albums, anything on flickr

I ran brew upgrade to see if helps but no

I did the same without any luck.

@Hrxn
Copy link
Contributor

Hrxn commented Jan 30, 2024

Almost certain that it has to be a site change then..

@patrikalienus
Copy link
Author

patrikalienus commented Jan 30, 2024

Almost certain that it has to be a site change then..

Yes. I think they've changed what their API response looks like. I've never built anything with python so haven't attempted to fix it myself.

@clouds321
Copy link

I checked the API via this page https://www.flickr.com/services/api/explore/flickr.people.getPhotos and it seems to be working, can't tell if the response changed or not.

But from the error message it seems JSONDecodeError is getting nothing in response

@clouds321
Copy link

it is working now.....

@patrikalienus
Copy link
Author

Looks like Flickr fixed this issue. I'm guessing the API response was malformed somehow.

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

No branches or pull requests

4 participants