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

[deviantart] KeyError: 'deviation' #2983

Closed
ermnick opened this issue Sep 29, 2022 · 9 comments
Closed

[deviantart] KeyError: 'deviation' #2983

ermnick opened this issue Sep 29, 2022 · 9 comments

Comments

@ermnick
Copy link

ermnick commented Sep 29, 2022

When trying to download from scraps, the extended_fetch endpoint responds with:

{
    "error": "invalid_request",
    "errorDescription": "Invalid or expired form submission",
    "errorDetails": {
        "csrf": "missing"
    },
    "status": "error"
}
@afterdelight
Copy link

did you log in when downloading?

@ermnick
Copy link
Author

ermnick commented Sep 29, 2022

I did. Were you not able to reproduce the issue?

@afterdelight
Copy link

please provide the example link

@ermnick
Copy link
Author

ermnick commented Sep 29, 2022

It's not user specific. It happens with all deviantart user that has the scraps folder.
Anyways, here's a random user I found from the popular section on the front page: https://www.deviantart.com/sandara/gallery/scraps

@afterdelight
Copy link

afterdelight commented Sep 29, 2022

on my end, i got this:

F:\downloader\deviant art>gallery-dl https://www.deviantart.com/sandara/gallery/scraps --verbose
[gallery-dl][debug] Version 1.23.2-dev
[gallery-dl][debug] Python 3.10.4 - Windows-10-10.0.19043-SP0
[gallery-dl][debug] requests 2.27.1 - urllib3 1.26.9
[gallery-dl][debug] Starting DownloadJob for 'https://www.deviantart.com/sandara/gallery/scraps'
[deviantart][debug] Using DeviantartScrapsExtractor for 'https://www.deviantart.com/sandara/gallery/scraps'
[deviantart][debug] Using custom API credentials (client-id 99999)
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.deviantart.com:443
[urllib3.connectionpool][debug] https://www.deviantart.com:443 "GET /api/v1/oauth2/user/profile/sandara HTTP/1.1" 200 1473
[deviantart][debug] Sleeping for 1.0 seconds
[urllib3.connectionpool][debug] https://www.deviantart.com:443 "GET /_napi/da-user-profile/api/gallery/contents?username=sandara&offset=0&limit=24&scraps_folder=true HTTP/1.1" 200 None
[deviantart][debug] Sleeping 2.00 seconds
[urllib3.connectionpool][debug] https://www.deviantart.com:443 "GET /_napi/da-browse/shared_api/deviation/extended_fetch?deviationid=858029765&username=sandara&type=art&include_session=false HTTP/1.1" 200 134
[deviantart][error] An unexpected error occurred: KeyError - 'deviation'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[deviantart][debug]
Traceback (most recent call last):
  File "C:\Python\Python310\lib\site-packages\gallery_dl\job.py", line 82, in run
    for msg in extractor:
  File "C:\Python\Python310\lib\site-packages\gallery_dl\extractor\deviantart.py", line 84, in items
    for deviation in self.deviations():
  File "C:\Python\Python310\lib\site-packages\gallery_dl\extractor\deviantart.py", line 968, in deviations
    deviation_uuid = eclipse_api.deviation_extended_fetch(
KeyError: 'deviation'

@ermnick
Copy link
Author

ermnick commented Sep 29, 2022

Ok, so that confirms it's not just something wrong on my end.
That's the same KeyError: 'deviation' error I'm getting.

@afterdelight
Copy link

Right, waiting for mikf to fix the issue.

mikf added a commit that referenced this issue Sep 29, 2022
send a 'csrf_token' with every Eclipse API request
@mikf
Copy link
Owner

mikf commented Sep 29, 2022

Fixed in commit 6c76b5f.

DeviantArt now requires a CSRF token for every request to their Eclipse API, which affects individual images, scraps, and followed users.

Right, waiting for mikf to fix the issue.

You could have done that from the very beginning.

@ermnick
Copy link
Author

ermnick commented Sep 29, 2022

Can confirm the issue is fixed now 👍

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

3 participants