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

When trying to create a tweet and adding a video to the tweet, it prompts: Error code 324 #92

Closed
aini1123x opened this issue May 8, 2024 · 1 comment

Comments

@aini1123x
Copy link

status = client.check_media_status("1788113005861027840")
print(status )
client.create_tweet(text="i love musk",media_ids="1788113005861027840")
print("okay")

Run Result:

{'media_id': 1788113005861027840, 'media_id_string': '1788113005861027840', 'media_key': '7_1788113005861027840', 'size': 974522, 'expires_after_secs': 85576, 'video': {'video_type': 'video/mp4'}, 'processing_info': {'state': 'succeeded', 'progress_percent': 100}}
Traceback (most recent call last):
File "C:\Users\山谷\PycharmProjects\pythonProject\定时.py", line 63, in
client.create_tweet(text="i love musk",media_ids="1788113005861027840")
File "C:\Users\山谷\PycharmProjects\pythonProject.venv\Lib\site-packages\twikit\client.py", line 1121, in create_tweet
raise_exceptions_from_response(response['errors'])
File "C:\Users\山谷\PycharmProjects\pythonProject.venv\Lib\site-packages\twikit\errors.py", line 100, in raise_exceptions_from_response
raise exception(error['message'])
twikit.errors.InvalidMedia: BadRequest: Tweet must not have more than 4 mediaIds. (324)

I actually only uploaded one video file, not more than four

@d60
Copy link
Owner

d60 commented May 17, 2024

@aini1123x Pass media_ids as a list, not as a string.

client.create_tweet(text="i love musk",media_ids=["1788113005861027840"])

@d60 d60 closed this as completed May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants