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

Uploading a GIF (From Linux) leads to error: "Media could not be displayed" #2013

Open
jetley opened this issue Nov 13, 2022 · 6 comments
Open
Labels
Need Follow-Up This needs to be followed up on to be actionable

Comments

@jetley
Copy link

jetley commented Nov 13, 2022

Hi,

I'm working on a bot where it randomly uploads media (still images or gifs) to Twitter. It works fine whne it's a still image, but when it's a GIF, the GIF can't be shown on Twitter: "Media couldn't be displayed" (Link for reference).

I've tried uploading the GIF manually to another account and there's not a single problem, the GIF can be displayed correctly, so there's no error when exporting the media to a GIF (since it's made with FFMPEG).

This is the code I'm using for uploading:

mediaUpload = api.media_upload(filename="./media_upload/GIF.gif", chunked=True, media_category="tweet_gif")
api.create_media_metadata(mediaUpload.media_id_string, altText)
api.update_status(data[5], media_ids=[mediaUpload.media_id_string])

The real problem: It works fine when the code is executed from Windows 11. The "Media could not be displayed" error ocurrs when the bot it's running under Debian GNU (Where the bot is hosted). In both Windows 11 and Debian, I'm using the latest stable version of Tweepy.

@lebraat
Copy link

lebraat commented Nov 14, 2022

Hey @jetley

Can you please further explain what you mean when you say 'I've tried uploading the GIF manually to another account':

  • How are you uploading manually?
  • Which other account?

And can you confirm that my reiteration of your problem is correct:
So far, you've identified that this is only an issue when executing the request via Debian.

@Harmon758 Harmon758 added the Need Follow-Up This needs to be followed up on to be actionable label Nov 15, 2022
@jetley
Copy link
Author

jetley commented Nov 16, 2022

Hi,

Thanks for replying (and sorry for my late reply).

I will try to explain myself better: When I say "I tried to upload the GIF manually" i mean the following: I uploaded the GIF to my personal account via twitter's desktop web page (drag and drop method) and it works fine. GIF is shown correctly when uploaded. Therefore, the GIF itself is not the problem but the SO from where it is being uploaded (in my case, Debian). The code used to upload in both Win11 and Debian is exactly the same.

For the moment, I'm considering making a few different VMs with different Linux distros in order to determine more closely the problem. If the issue only happens to exist in Debian, I can switch to another OS effortlessly.

@jetley
Copy link
Author

jetley commented Jan 14, 2023

Hi, any updates on this bug?...

@Harmon758
Copy link
Member

@boidushya Please don't ghost ping.

Regardless, a reproducible example (MCVE/SSCCE) is necessary here.
Although, if this is an OS-specific issue, I don't have an easy way of reproducing it on my end.
This seems likely an issue on Twitter's end anyway, but Daniel (lebraat) no longer works at Twitter, so I don't really have any means of following up to see if it is or not anymore.

@boidushya
Copy link

boidushya commented May 28, 2023 via email

@jakeonfire
Copy link

if anybody encounters this issue, i was able to solve it per the nice documentation summary here: sferik/x-ruby#22 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need Follow-Up This needs to be followed up on to be actionable
Projects
None yet
Development

No branches or pull requests

5 participants