Error when sending GIF with Tweepy
See original GitHub issueHi,
I want to send a GIF with Tweepy but I’ve an error whereas with an JPG or PNG, it’s ok. Here is the simple script:
#!/usr/bin/python
import tweepy
CONSUMER_KEY = ""
CONSUMER_SECRET = ""
ACCESS_TOKEN = ""
ACCESS_TOKEN_SECRET = ""
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
api = tweepy.API(auth)
api.update_with_media(filename="/root/image.gif")
The error encountered :
Traceback (most recent call last):
File "./test.py", line 15, in <module>
api.update_with_media(filename="/root/image.gif")
File "/usr/local/lib/python2.7/dist-packages/tweepy/api.py", line 231, in update_with_media
)(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/tweepy/binder.py", line 243, in _call
return method.execute()
File "/usr/local/lib/python2.7/dist-packages/tweepy/binder.py", line 189, in execute
raise TweepError('Failed to send request: %s' % e)
tweepy.error.TweepError: Failed to send request:
tweepy 3.4.0 python 2.7.9 debian 8.2
Any idea ? Thanks
Issue Analytics
- State:
- Created 8 years ago
- Comments:19 (1 by maintainers)
Top Results From Across the Web
Frequently Asked Questions — tweepy 4.12.1 documentation
If you are encountering a 400 Bad Request error when uploading large GIFs or other errors/issues with uploading videos, make sure to pass...
Read more >How can i respond to tweets with images with tweepy and ...
i'am using tweepy and i dont reach to tweet with an image in my response. When i run my code the console says...
Read more >An error is detected when attaching an image to the welcome ...
This is the endpoint I'm trying to create the welcome message for. ... When I try to attach an image here, it says...
Read more >Twitter API Response Codes & Error Support - Twitter Developer
Get Twitter API response codes and error support through Twitter Developer here.
Read more >Twitter error: “media type unrecognized” when creating ...
The error “media type unrecognized” usually originates from the Image, Video Or GIF field in the 'Create Tweet' in Twitter action step.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@thomaslawn try:
I think the media_ids kwarg expects a list (or other iterable).
As pointed out, this seems to have been an issue with large POST requests with requests and urllib3 (https://github.com/urllib3/urllib3/issues/717).
That’s correct, although unrelated to this issue.
For code block usage, see https://help.github.com/articles/creating-and-highlighting-code-blocks/.
@airjump That’s not related to this issue. However, that also seems to have been an issue with requests. See #687.