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

[twitter][error] An unexpected error occurred: KeyError - 'expanded_url' #5504

Closed
Barbarella6666666 opened this issue Apr 24, 2024 · 2 comments

Comments

@Barbarella6666666
Copy link

Barbarella6666666 commented Apr 24, 2024

gallery-dl --cookies $HOME/Downloads/twitter-cookies.txt --verbose https://twitter.com/retweetpics24                                                                     
[gallery-dl][debug] Version 1.26.9
[gallery-dl][debug] Python 3.11.3 - Linux-6.5.0-28-generic-x86_64-with-glibc2.35
[gallery-dl][debug] requests 2.31.0 - urllib3 2.0.2
[gallery-dl][debug] Configuration Files ['${HOME}/.config/gallery-dl/config.json']
[gallery-dl][debug] Starting DownloadJob for 'https://twitter.com/retweetpics24'
[twitter][debug] Using TwitterUserExtractor for 'https://twitter.com/retweetpics24'
[twitter][debug] Using TwitterTimelineExtractor for 'https://twitter.com/retweetpics24/timeline'
[twitter][debug] Loading cookies from '/home/<user>/Downloads/twitter-cookies.txt'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): twitter.com:443
[urllib3.connectionpool][debug] https://twitter.com:443 "GET /i/api/graphql/k5XapwcSikNsEsILW5FvgA/UserByScreenName?variables=%7B%22screen_name%22%3A%22retweetpics24%22%2C%22withSafetyModeUserFields%22%3Atrue%7D&features=%7B%22hidden_profile_likes_enabled%22%3Atrue%2C%22hidden_profile_subscriptions_enabled%22%3Atrue%2C%22responsive_web_graphql_exclude_directive_enabled%22%3Atrue%2C%22verified_phone_label_enabled%22%3Afalse%2C%22highlights_tweets_tab_ui_enabled%22%3Atrue%2C%22responsive_web_twitter_article_notes_tab_enabled%22%3Atrue%2C%22creator_subscriptions_tweet_preview_api_enabled%22%3Atrue%2C%22responsive_web_graphql_skip_user_profile_image_extensions_enabled%22%3Afalse%2C%22responsive_web_graphql_timeline_navigation_enabled%22%3Atrue%2C%22subscriptions_verification_info_is_identity_verified_enabled%22%3Atrue%2C%22subscriptions_verification_info_verified_since_enabled%22%3Atrue%7D HTTP/1.1" 200 736
[urllib3.connectionpool][debug] https://twitter.com:443 "GET /i/api/graphql/5ICa5d9-AitXZrIA3H-4MQ/UserTweets?variables=%7B%22userId%22%3A%221774452655860916226%22%2C%22count%22%3A100%2C%22includePromotedContent%22%3Afalse%2C%22withQuickPromoteEligibilityTweetFields%22%3Atrue%2C%22withVoice%22%3Atrue%2C%22withV2Timeline%22%3Atrue%7D&features=%7B%22responsive_web_graphql_exclude_directive_enabled%22%3Atrue%2C%22verified_phone_label_enabled%22%3Afalse%2C%22creator_subscriptions_tweet_preview_api_enabled%22%3Atrue%2C%22responsive_web_graphql_timeline_navigation_enabled%22%3Atrue%2C%22responsive_web_graphql_skip_user_profile_image_extensions_enabled%22%3Afalse%2C%22c9s_tweet_anatomy_moderator_badge_enabled%22%3Atrue%2C%22tweetypie_unmention_optimization_enabled%22%3Atrue%2C%22responsive_web_edit_tweet_api_enabled%22%3Atrue%2C%22graphql_is_translatable_rweb_tweet_is_translatable_enabled%22%3Atrue%2C%22view_counts_everywhere_api_enabled%22%3Atrue%2C%22longform_notetweets_consumption_enabled%22%3Atrue%2C%22responsive_web_twitter_article_tweet_consumption_enabled%22%3Atrue%2C%22tweet_awards_web_tipping_enabled%22%3Afalse%2C%22freedom_of_speech_not_reach_fetch_enabled%22%3Atrue%2C%22standardized_nudges_misinfo%22%3Atrue%2C%22tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled%22%3Atrue%2C%22rweb_video_timestamps_enabled%22%3Atrue%2C%22longform_notetweets_rich_text_read_enabled%22%3Atrue%2C%22longform_notetweets_inline_media_enabled%22%3Atrue%2C%22responsive_web_media_download_video_enabled%22%3Atrue%2C%22responsive_web_enhance_cards_enabled%22%3Afalse%7D HTTP/1.1" 200 16561
[twitter][error] An unexpected error occurred: KeyError - 'expanded_url'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[twitter][debug] 
Traceback (most recent call last):
  File "/home/<user>/.local/lib/python3.11/site-packages/gallery_dl/job.py", line 127, in run
    for msg in extractor:
  File "/home/<user>/.local/lib/python3.11/site-packages/gallery_dl/extractor/twitter.py", line 128, in items
    self._extract_twitpic(data, files)
  File "/home/<user>/.local/lib/python3.11/site-packages/gallery_dl/extractor/twitter.py", line 246, in _extract_twitpic
    url = url["expanded_url"]
          ~~~^^^^^^^^^^^^^^^^
KeyError: 'expanded_url'
@fireattack
Copy link
Contributor

Fixed in master (347af7f), wait for next release or use dev build: https://github.com/gdl-org/builds/releases

@mikf
Copy link
Owner

mikf commented Apr 25, 2024

Duplicate of #5490

@mikf mikf marked this as a duplicate of #5490 Apr 25, 2024
@mikf mikf closed this as completed Apr 25, 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

4 participants
@fireattack @mikf @Barbarella6666666 and others