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

[Behance] KeyError: 'fields' #5965

Closed
KumoSiunaus opened this issue Aug 8, 2024 · 2 comments
Closed

[Behance] KeyError: 'fields' #5965

KumoSiunaus opened this issue Aug 8, 2024 · 2 comments

Comments

@KumoSiunaus
Copy link

PS > gallery-dl --verbose https://www.behance.net/gallery/85895731
[gallery-dl][debug] Version 1.27.2
[gallery-dl][debug] Python 3.12.4 - Windows-10-10.0.19045-SP0
[gallery-dl][debug] requests 2.32.3 - urllib3 2.2.2
[gallery-dl][debug] Configuration Files ['%APPDATA%\\gallery-dl\\config.json']
[gallery-dl][debug] Starting DownloadJob for 'https://www.behance.net/gallery/85895731'
[behance][debug] Using BehanceGalleryExtractor for 'https://www.behance.net/gallery/85895731'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.behance.net:443
[urllib3.connectionpool][debug] https://www.behance.net:443 "GET /gallery/85895731/a HTTP/11" 200 95743
[behance][error] An unexpected error occurred: KeyError - 'fields'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[behance][debug]
Traceback (most recent call last):
  File "C:\Python312\Lib\site-packages\gallery_dl\job.py", line 151, in run
    for msg in extractor:
  File "C:\Python312\Lib\site-packages\gallery_dl\extractor\behance.py", line 104, in items
    data = self.get_gallery_data()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\gallery_dl\extractor\behance.py", line 128, in get_gallery_data
    return self._update(data["project"]["project"])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\gallery_dl\extractor\behance.py", line 52, in _update
    if data["fields"] and isinstance(data["fields"][0], dict):
       ~~~~^^^^^^^^^^
KeyError: 'fields'
@mikf
Copy link
Owner

mikf commented Aug 8, 2024

Extracting files from video modules is broken as well:

$ gallery-dl https://www.behance.net/gallery/101185577/COLCCI
[behance][warning] No download URLs for video 583229697
[behance][warning] No download URLs for video 583229699
[behance][warning] No download URLs for video 583229701

@KumoSiunaus
Copy link
Author

KumoSiunaus commented Aug 8, 2024

It seems "fields" is removed from the original data. I tried comment out the following code in behance.py and it works well for image downloading.

def _update(self, data):
    # compress data to simple lists
    # if data["fields"] and isinstance(data["fields"][0], dict):
    #     data["fields"] = [
    #         field.get("name") or field.get("label")
    #         for field in data["fields"]
    #     ]
    
    ...

For video, module["videoData"]["renditions"] is also removed and I cannot find the urls for videos for now.

mikf added a commit that referenced this issue Aug 10, 2024
a lot slower than before since each video now requires an extra HTTP
request and 'sleep-request' is set to 2s-4s by default.

it now also requires ytdl.
@mikf mikf closed this as completed Aug 10, 2024
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

2 participants