diff --git a/lib/twitter/rest/tweets.rb b/lib/twitter/rest/tweets.rb index c96fc52d5..379657fca 100644 --- a/lib/twitter/rest/tweets.rb +++ b/lib/twitter/rest/tweets.rb @@ -321,6 +321,10 @@ def unretweet(*args) end.compact end + def upload_status(media_id) + Twitter::REST::Request.new(self, :get, "https://upload.twitter.com/1.1/media/upload.json?command=STATUS&media_id=#{media_id}").perform + end + private # Uploads images and videos. Videos require multiple requests and uploads in chunks of 5 Megabytes. @@ -334,6 +338,7 @@ def upload(media) # rubocop:disable MethodLength, AbcSize init = Twitter::REST::Request.new(self, :post, 'https://upload.twitter.com/1.1/media/upload.json', command: 'INIT', media_type: 'video/mp4', + media_category: 'tweet_video', total_bytes: media.size).perform until media.eof?