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

Patreon Error Key Error -name- #5358

Closed thechef95 closed 7 months ago

thechef95 commented 7 months ago

im receving this error when running the script

[patreon][error] An unexpected error occurred: KeyError - 'name'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .

here is the output for --verbose [gallery-dl][debug] Version 1.26.2 [gallery-dl][debug] Python 3.11.4 - Windows-10-10.0.22631-SP0 [gallery-dl][debug] requests 2.31.0 - urllib3 2.0.3 [gallery-dl][debug] Configuration Files ['%USERPROFILE%\gallery-dl\config.json'] [gallery-dl][debug] Starting DownloadJob for 'https://www.patreon.com/home' [patreon][debug] Using PatreonUserExtractor for 'https://www.patreon.com/home' [patreon][debug] TLS 1.2 disabled. [urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.patreon.com:443 [urllib3.connectionpool][debug] https://www.patreon.com:443 "GET /api/stream?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&page%5Bcursor%5D=null&filter%5Bis_following%5D=true&json-api-use-default-includes=false&json-api-version=1.0 HTTP/1.1" 200 None [urllib3.connectionpool][debug] https://www.patreon.com:443 "GET /api/user/97969241 HTTP/1.1" 200 None [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/100698109/38141e77d53f4419b9044c2b5f150e4f/eyJhIjoxLCJwIjoxfQ%3D%3D/1.jpg?token-time=1711065600&token-hash=IOb2hRnKrtETs1e8FwtgMh4rep6notybCozbmKOJiQA%3D HTTP/1.1" 200 0

Z:\gallery-dl\patreon\Kittykrystl\2024-03-20_100698109_1_1.jpg

[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/100698109/23adadca1093430885e10b78d686dc9b/eyJhIjoxLCJwIjoxfQ%3D%3D/1.jpg?token-time=1711065600&token-hash=1Y63t-lRKoOY1OE4DgQT6pEXHvs1gNmwb1A53iHtUOk%3D HTTP/1.1" 200 0

Z:\gallery-dl\patreon\Kittykrystl\2024-03-20_100698109_2_1.jpg

[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/100698109/c2cd9214695f4d56b44489cbd6c03c6e/eyJhIjoxLCJwIjoxfQ%3D%3D/1.jpg?token-time=1711065600&token-hash=lxNXFSYLUxnwsjI4PX2MEQyPbtnIJ8XCej3Z_LdJ18E%3D HTTP/1.1" 200 0

Z:\gallery-dl\patreon\Kittykrystl\2024-03-20_100698109_3_1.jpg

[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/100698109/82d1d0a8a47541aa9a48b0decba30132/eyJhIjoxLCJwIjoxfQ%3D%3D/1.jpg?token-time=1711065600&token-hash=e8zVP4SNYkJlvpwy--8CTUYpQTccsSogLKOXqFW7D-Q%3D HTTP/1.1" 200 0

Z:\gallery-dl\patreon\Kittykrystl\2024-03-20_100698109_4_1.jpg

[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/100698109/91283f0eeda04be7a08d469ec082c722/eyJhIjoxLCJwIjoxfQ%3D%3D/1.jpg?token-time=1711065600&token-hash=cRV9dYfDqYPyrArxuCEKM1qku_h-HKGBv_u9F2apmOw%3D HTTP/1.1" 200 0

Z:\gallery-dl\patreon\Kittykrystl\2024-03-20_100698109_5_1.jpg

[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/100698109/59db5266bed3496f95804c057ad03b8f/eyJhIjoxLCJwIjoxfQ%3D%3D/1.jpg?token-time=1711065600&token-hash=mMJqCG8Od4SPwwWY5jUQDZ0u8i5oQh5zqqPY9h5Z-NE%3D HTTP/1.1" 200 0

Z:\gallery-dl\patreon\Kittykrystl\2024-03-20_100698109_6_1.jpg

[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/100698109/0f20a9848970441eb1148b84ef6fd6ec/eyJhIjoxLCJwIjoxfQ%3D%3D/1.jpg?token-time=1711065600&token-hash=BCyEK3GP0pPCGzzuKqa53H2Ikew91KFjMWuVesdjE_0%3D HTTP/1.1" 200 0

Z:\gallery-dl\patreon\Kittykrystl\2024-03-20_100698109_7_1.jpg

[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/100698109/b96041741fd5453b8a7a730a6b0b91c9/eyJhIjoxLCJwIjoxfQ%3D%3D/1.jpg?token-time=1711065600&token-hash=Qc4M-psgSbucCSwR4O0l9bakjYYQt_22FQ5ndHx2Skg%3D HTTP/1.1" 200 0

Z:\gallery-dl\patreon\Kittykrystl\2024-03-20_100698109_8_1.jpg

[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/100698109/38141e77d53f4419b9044c2b5f150e4f/eyJ3IjoxNjAwfQ%3D%3D/1.jpg?token-time=1712188800&token-hash=RQtDa3wsWbbTOYJ48gLbTMeyrteFtiE6rQ_vfPuiC1k%3D HTTP/1.1" 200 0 [patreon][debug] skipping https://c10.patreonusercontent.com/4/patreon-media/p/post/100698109/38141e77d53f4419b9044c2b5f150e4f/eyJ3IjoxNjAwfQ%3D%3D/1.jpg?token-time=1712188800&token-hash=RQtDa3wsWbbTOYJ48gLbTMeyrteFtiE6rQ_vfPuiC1k%3D (38141e77d53f4419b9044c2b5f150e4f image_large) [patreon][error] An unexpected error occurred: KeyError - 'name'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues . [patreon][debug] Traceback (most recent call last): File "C:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\job.py", line 124, in run for msg in extractor: File "C:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\extractor\patreon.py", line 47, in items for kind, url, name in itertools.chain.from_iterable( File "C:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\extractor\patreon.py", line 48, in g(post) for g in generators): ^^^^^^^ File "C:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\extractor\patreon.py", line 63, in _postfile return (("postfile", postfile["url"], postfile["name"]),)


KeyError: 'name'
mikf commented 7 months ago

[gallery-dl][debug] Version 1.26.2

Update to at least v1.26.7 (#5048, 1c68b7df)

thechef95 commented 7 months ago

is there an update command or do i jst have to run the installer again?

mikf commented 7 months ago
py -3 -m pip install -U gallery-dl

both installs and updates gallery-dl to the latest version.

thechef95 commented 7 months ago

thank you

thechef95 commented 7 months ago

i did the update and got the same error heres the output after --verbose [gallery-dl][debug] Version 1.26.2 [gallery-dl][debug] Python 3.11.4 - Windows-10-10.0.22631-SP0 [gallery-dl][debug] requests 2.31.0 - urllib3 2.0.3 [gallery-dl][debug] Configuration Files ['%USERPROFILE%\gallery-dl\config.json'] [gallery-dl][debug] Starting DownloadJob for 'https://www.patreon.com/home' [patreon][debug] Using PatreonUserExtractor for 'https://www.patreon.com/home' [patreon][debug] TLS 1.2 disabled. [urllib3.connectionpool][debug] Starting new HTTPS connection (1): www.patreon.com:443 [urllib3.connectionpool][debug] https://www.patreon.com:443 "GET /api/stream?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&page%5Bcursor%5D=null&filter%5Bis_following%5D=true&json-api-use-default-includes=false&json-api-version=1.0 HTTP/1.1" 200 None [urllib3.connectionpool][debug] https://www.patreon.com:443 "GET /api/user/97969241 HTTP/1.1" 200 None [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/100698109/38141e77d53f4419b9044c2b5f150e4f/eyJhIjoxLCJwIjoxfQ%3D%3D/1.jpg?token-time=1711065600&token-hash=IOb2hRnKrtETs1e8FwtgMh4rep6notybCozbmKOJiQA%3D HTTP/1.1" 200 0

Z:\gallery-dl\patreon\Kittykrystl\2024-03-20_100698109_1_1.jpg

[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/100698109/23adadca1093430885e10b78d686dc9b/eyJhIjoxLCJwIjoxfQ%3D%3D/1.jpg?token-time=1711065600&token-hash=1Y63t-lRKoOY1OE4DgQT6pEXHvs1gNmwb1A53iHtUOk%3D HTTP/1.1" 200 0

Z:\gallery-dl\patreon\Kittykrystl\2024-03-20_100698109_2_1.jpg

[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/100698109/c2cd9214695f4d56b44489cbd6c03c6e/eyJhIjoxLCJwIjoxfQ%3D%3D/1.jpg?token-time=1711065600&token-hash=lxNXFSYLUxnwsjI4PX2MEQyPbtnIJ8XCej3Z_LdJ18E%3D HTTP/1.1" 200 0

Z:\gallery-dl\patreon\Kittykrystl\2024-03-20_100698109_3_1.jpg

[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/100698109/82d1d0a8a47541aa9a48b0decba30132/eyJhIjoxLCJwIjoxfQ%3D%3D/1.jpg?token-time=1711065600&token-hash=e8zVP4SNYkJlvpwy--8CTUYpQTccsSogLKOXqFW7D-Q%3D HTTP/1.1" 200 0

Z:\gallery-dl\patreon\Kittykrystl\2024-03-20_100698109_4_1.jpg

[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/100698109/91283f0eeda04be7a08d469ec082c722/eyJhIjoxLCJwIjoxfQ%3D%3D/1.jpg?token-time=1711065600&token-hash=cRV9dYfDqYPyrArxuCEKM1qku_h-HKGBv_u9F2apmOw%3D HTTP/1.1" 200 0

Z:\gallery-dl\patreon\Kittykrystl\2024-03-20_100698109_5_1.jpg

[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/100698109/59db5266bed3496f95804c057ad03b8f/eyJhIjoxLCJwIjoxfQ%3D%3D/1.jpg?token-time=1711065600&token-hash=mMJqCG8Od4SPwwWY5jUQDZ0u8i5oQh5zqqPY9h5Z-NE%3D HTTP/1.1" 200 0

Z:\gallery-dl\patreon\Kittykrystl\2024-03-20_100698109_6_1.jpg

[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/100698109/0f20a9848970441eb1148b84ef6fd6ec/eyJhIjoxLCJwIjoxfQ%3D%3D/1.jpg?token-time=1711065600&token-hash=BCyEK3GP0pPCGzzuKqa53H2Ikew91KFjMWuVesdjE_0%3D HTTP/1.1" 200 0

Z:\gallery-dl\patreon\Kittykrystl\2024-03-20_100698109_7_1.jpg

[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/100698109/b96041741fd5453b8a7a730a6b0b91c9/eyJhIjoxLCJwIjoxfQ%3D%3D/1.jpg?token-time=1711065600&token-hash=Qc4M-psgSbucCSwR4O0l9bakjYYQt_22FQ5ndHx2Skg%3D HTTP/1.1" 200 0

Z:\gallery-dl\patreon\Kittykrystl\2024-03-20_100698109_8_1.jpg

[urllib3.connectionpool][debug] https://c10.patreonusercontent.com:443 "HEAD /4/patreon-media/p/post/100698109/38141e77d53f4419b9044c2b5f150e4f/eyJ3IjoxNjAwfQ%3D%3D/1.jpg?token-time=1712188800&token-hash=RQtDa3wsWbbTOYJ48gLbTMeyrteFtiE6rQ_vfPuiC1k%3D HTTP/1.1" 200 0 [patreon][debug] skipping https://c10.patreonusercontent.com/4/patreon-media/p/post/100698109/38141e77d53f4419b9044c2b5f150e4f/eyJ3IjoxNjAwfQ%3D%3D/1.jpg?token-time=1712188800&token-hash=RQtDa3wsWbbTOYJ48gLbTMeyrteFtiE6rQ_vfPuiC1k%3D (38141e77d53f4419b9044c2b5f150e4f image_large) [patreon][error] An unexpected error occurred: KeyError - 'name'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues . [patreon][debug] Traceback (most recent call last): File "C:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\job.py", line 124, in run for msg in extractor: File "C:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\extractor\patreon.py", line 47, in items for kind, url, name in itertools.chain.from_iterable( File "C:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\extractor\patreon.py", line 48, in g(post) for g in generators): ^^^^^^^ File "C:\Users\danie\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\extractor\patreon.py", line 63, in _postfile return (("postfile", postfile["url"], postfile["name"]),)


KeyError: 'name'
mikf commented 7 months ago

[gallery-dl][debug] Version 1.26.2

You are still running the old version. Use py -3 -m gallery_dl ... and check with --version.

thechef95 commented 7 months ago

did that still old version

PS C:\Users\danie> py -3 -m pip install -U gallery-dl Requirement already satisfied: gallery-dl in c:\users\danie\appdata\local\programs\python\python312\lib\site-packages (1.26.8) Requirement already satisfied: requests>=2.11.0 in c:\users\danie\appdata\local\programs\python\python312\lib\site-packages (from gallery-dl) (2.31.0) Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\danie\appdata\local\programs\python\python312\lib\site-packages (from requests>=2.11.0->gallery-dl) (3.3.2) Requirement already satisfied: idna<4,>=2.5 in c:\users\danie\appdata\local\programs\python\python312\lib\site-packages (from requests>=2.11.0->gallery-dl) (3.6) Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\danie\appdata\local\programs\python\python312\lib\site-packages (from requests>=2.11.0->gallery-dl) (2.2.1) Requirement already satisfied: certifi>=2017.4.17 in c:\users\danie\appdata\local\programs\python\python312\lib\site-packages (from requests>=2.11.0->gallery-dl) (2024.2.2) PS C:\Users\danie> gallery-dl --version 1.26.2

Hrxn commented 7 months ago

Open CMD.exe

Enter where gallery-dl

Make sure to use the right one.

mikf commented 7 months ago

did that still old version

No, you didn't. You ran

py -3 -m pip install -U gallery-dl

a second time, which invokes pip to install and update gallery-dl again, while I recommended using the following instead of plain gallery-dl

py -3 -m gallery_dl

You have at least 2 Python interpreters installed, 3.11 which is used for gallery-dl and 3.12 which gets used by py -3 ….

As a band-aid solution, you can run

py -3.11 -m pip install -U gallery-dl

to update the 3.11 version, but you should preferably fix this and have only one Python on your system.

thechef95 commented 7 months ago

so i did all that and the version is correct now. do i have to use py -3 -m gallery_dl every time i run a new script?

mikf commented 7 months ago

Just uninstall Python 3.12. This will most likely fix all of your problems. If not, uninstall everything Python and re-install only one version of it.