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] "Your Tweet has been withheld" error #4349

Closed
spacehare opened this issue Jul 25, 2023 · 1 comment
Closed

[Twitter] "Your Tweet has been withheld" error #4349

spacehare opened this issue Jul 25, 2023 · 1 comment
Labels

Comments

@spacehare
Copy link

error on 1.25.8

[twitter][warning] 'Your Tweet has been withheld in: United States.' (1554557430700318729)
[twitter][error] An unexpected error occurred: KeyError - 'id_str'. 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 "C:\Users\Rabbit\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\job.py", line 96, in run
    for msg in extractor:
  File "C:\Users\Rabbit\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\extractor\twitter.py", line 129, in items
    tdata = self._transform_tweet(tweet)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Rabbit\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\extractor\twitter.py", line 271, in _transform_tweet
    author = self._transform_user(author)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Rabbit\AppData\Local\Programs\Python\Python311\Lib\site-packages\gallery_dl\extractor\twitter.py", line 341, in _transform_user
    uid = user.get("rest_id") or user["id_str"]
                                 ~~~~^^^^^^^^^^
KeyError: 'id_str'

after running

gallery-dl -D "I:\art backup\twitter" --sleep 4 -o skip=true https://twitter.com/.../with_replies --verbose

with config

        {
            "username": "...",
            "password": "...",
            "cards": false,
            "conversations": false,
            "pinned": false,
            "quoted": true,
            "replies": true,
            "retweets": true,
            "strategy": null,
            "text-tweets": true,
            "twitpic": false,
            "unique": true,
            "users": "timeline",
            "videos": true,
			"filename": "twitter_{author[name]}_{tweet_id}_{num}.{extension}",
			"postprocessors":[
                {"name": "metadata", "event": "post", "filename": "twitter_{author[name]}_{tweet_id}_main.json"}
            ]
        },
@mikf
Copy link
Owner

mikf commented Jul 28, 2023

This should be fixed with 7fbc304, but I haven't been able to actually test it myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants