Closed reboot-mk closed 6 months ago
Did you try with :
media = X::MediaUploader.chunked_upload(client: client, file_path: "test.mp4", media_category: "tweet_video")
X::MediaUploader.await_processing(client: client, media: media)
tweet_body = {text: post_message, media: {media_ids: [media["media_id_string"]]}}
client.post("tweets", tweet_body.to_json)
There is an example here : https://github.com/sferik/x-ruby/blob/main/examples/chunked_media_upload.rb
It worked, thank you so much! My apologies for not trying this out sooner, my files were light so I didn't think I'd need to use chunked uploading. I did have to require tmpdir
at the beginning of my file, not sure if that's intentional.
Hello, here's my code:
Which throws:
Here's test.mp4
I'm not sure what I'm doing wrong... This video file used to work with the previous Twitter gem, so I don't think it's a file format issue. I'm able to upload pictures, so I don't think it's an API access issue either.
I'm encountering a similar issue with gif files when uploading a gif and setting the type to tweet_gif. Although I managed to upload this gif file, but I couldn't play it with my browser or even the Android client.