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

KeyError: 'name' when downloading Patreon #5093

Closed
Dark-Obsidian opened this issue Jan 20, 2024 · 5 comments
Closed

KeyError: 'name' when downloading Patreon #5093

Dark-Obsidian opened this issue Jan 20, 2024 · 5 comments

Comments

@Dark-Obsidian
Copy link

I got the below KeyError: 'name' error when trying to update a Patreon library recently (the original download worked fine)...

Command

> gallery-DL "https://patreon.com/MansterpieceAI" -D "[redacted]\Patreon\MansterpieceAI"
  --mtime-from-date  --filter "not isinstance(date, datetime) or date >= datetime(2023, 9, 1) or abort()"

Result / Output

[gallery-dl][debug] Version 1.26.5 - Executable
[gallery-dl][debug] Python 3.8.10 - Windows-10-10.0.22631
[gallery-dl][debug] requests 2.31.0 - urllib3 2.1.0
[gallery-dl][debug] Configuration Files ['%APPDATA%\\gallery-dl\\config.json']
[gallery-dl][debug] Starting DownloadJob for 'https://patreon.com/MansterpieceAI'
[patreon][debug] Using PatreonCreatorExtractor for 'https://patreon.com/MansterpieceAI'
[patreon][debug] TLS 1.2 disabled.
[patreon][warning] no 'session_id' cookie set
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.patreon.com:443
[urllib3.connectionpool][debug] https://www.patreon.com:443 "GET /MansterpieceAI/posts HTTP/1.1" 301 None
[urllib3.connectionpool][debug] https://www.patreon.com:443 "GET /MansterpieceAI HTTP/1.1" 200 None
[patreon][debug] campaign_id: 10615359
[urllib3.connectionpool][debug] https://www.patreon.com:443 "GET /api/posts?include=campaign,access_rules,attachments,audio,images,media,native_video_insights,poll.choices,poll.current_user_responses.user,poll.current_user_responses.choice,poll.current_user_responses.poll,user,user_defined_tags,ti_checks&fields%5Bcampaign%5D=currency,show_audio_post_download_links,avatar_photo_url,avatar_photo_image_urls,earnings_visibility,is_nsfw,is_monthly,name,url&fields%5Bpost%5D=change_visibility_at,comment_count,commenter_count,content,current_user_can_comment,current_user_can_delete,current_user_can_view,current_user_has_liked,embed,image,insights_last_updated_at,is_paid,like_count,meta_image_url,min_cents_pledged_to_view,post_file,post_metadata,published_at,patreon_url,post_type,pledge_url,preview_asset_type,thumbnail,thumbnail_url,teaser_text,title,upgrade_url,url,was_posted_by_campaign_owner,has_ti_violation,moderation_status,post_level_suspension_removal_date,pls_one_liners_by_category,video_preview,view_count&fields%5Bpost_tag%5D=tag_type,value&fields%5Buser%5D=image_url,full_name,url&fields%5Baccess_rule%5D=access_rule_type,amount_cents&fields%5Bmedia%5D=id,image_urls,download_url,metadata,file_name&fields%5Bnative_video_insights%5D=average_view_duration,average_view_pct,has_preview,id,last_updated_at,num_views,preview_views,video_duration&filter%5Bcampaign_id%5D=10615359&filter%5Bcontains_exclusive_posts%5D=true&filter%5Bis_draft%5D=false&sort=-published_at&json-api-version=1.0 HTTP/1.1" 200 None
[urllib3.connectionpool][debug] https://www.patreon.com:443 "GET /api/user/94499146 HTTP/1.1" 200 None
[patreon][debug] Using download archive '[redacted]/AppData/Gallery-DL/Archive.sqlite3'
[patreon][debug] Active postprocessor modules: [MetadataPP, MetadataPP, ClassifyPP, MtimePP]
# [redacted]\Patreon\MansterpieceAI\#296 Mystical Guy #01 (MansterpieceAI - 96832271).jpg
# [redacted]\Patreon\MansterpieceAI\#296 Mystical Guy #02 (MansterpieceAI - 96832271).jpg
# [redacted]\Patreon\MansterpieceAI\#296 Mystical Guy #03 (MansterpieceAI - 96832271).jpg
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): c10.patreonusercontent.com:443
[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/96832271/b5691b9d2b67466f8cfa480e2ecbea01/eyJ3IjoxNjAwfQ%3D%3D/1.jpg?token-time=1707004800&token-hash=[redacted] HTTP/1.1" 200 0
[patreon][debug] skipping https://c10.patreonusercontent.com/4/patreon-media/p/post/96832271/b5691b9d2b67466f8cfa480e2ecbea01/eyJ3IjoxNjAwfQ%3D%3D/1.jpg?token-time=1707004800&token-hash=[redacted] (b5691b9d2b67466f8cfa480e2ecbea01 image_large)

[patreon][error] An unexpected error occurred: KeyError - 'name'.
Please report this issue on https://github.com/mikf/gallery-dl/issues.

[patreon][debug]
Traceback (most recent call last):
  File "gallery_dl\job.pyc", line 127, in run
  File "gallery_dl\extractor\patreon.pyc", line 47, in items
  File "gallery_dl\extractor\patreon.pyc", line 48, in <genexpr>
  File "gallery_dl\extractor\patreon.pyc", line 63, in _postfile
KeyError: 'name'
@mikf
Copy link
Owner

mikf commented Jan 20, 2024

Duplicate of #5048.
Fixed in 1c68b7d.

@Dark-Obsidian
Copy link
Author

Ah OK, thanks @mikf!

NB: I did do a search for keyerror name patreon before posting (honestly), but in hindsight I realise it defaults the search to open issues only and I probably should've modified this to include closed issues too.

Appreciate you replying quickly anyway, thanks!

@Dark-Obsidian
Copy link
Author

UPDATE: Updated gallery-dl to 1.26.6 (was on 1.26.5) but get the same error 🤔...

Looking a little more into it, I see that...
1c68b7d was committed 1 week ago
v1.26.6 was published before this (2 weeks ago)

To check my understanding -- I use the compiled gallery-dl.exe so to get this fixed today, I would need to...

  • Either, clone the repo and switch to running the python version of gallery-dl instead
    ❓Right?
  • Or, wait for a new version of gallery-dl to be published
    ❓If so, do you any releases planned or have a rough idea when this might be at all?

@mikf
Copy link
Owner

mikf commented Jan 20, 2024

You can get auto-built executables from the latest code at https://github.com/mikf/gallery-dl/actions/workflows/executables.yml, for example https://github.com/mikf/gallery-dl/actions/runs/7595827930/artifacts/1183154803

The next release (v1.26.7) will be in the next few days.

@Dark-Obsidian
Copy link
Author

Dark-Obsidian commented Jan 20, 2024

Ah, great! -- I write various scripts but haven't used GitHub loads TBH so wasn't aware of the actions/workflows area (or the auto-compiled .exe's) so that's really useful to know! 👍🏼

Annoyingly, Windows Defender flagged the file as infected with Win32/Wacatac.H!ml and immediately quarantined/deleted it but guessing that is a false-positive because of the file being an automatically-built maybe 😕 dunno... But anyway, that is something for me to sort with my PC/AV (or worse case scenario, just wait a few days for 1.26.7) so is all good -- thanks again!

@mikf mikf closed this as completed Jan 21, 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