Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #663 from Bracciata/feature/gifs_over_5mb
Browse files Browse the repository at this point in the history
Feature: Allow ability to upload gifs in the range of 5MB to 15MB.
  • Loading branch information
bear authored Dec 19, 2021
2 parents 773bce9 + 56ce285 commit 13276b6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions twitter/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,10 @@ def _UploadMediaChunkedInit(self,
parameters['media_type'] = media_type
parameters['total_bytes'] = file_size

# Without this GIF files over 5MB but less than 15MB will fail uploading.
if media_type == 'image/gif' and file_size > 5242880:
parameters['media_category'] = 'tweet_gif'

resp = self._RequestUrl(url, 'POST', data=parameters)
data = self._ParseAndCheckTwitter(resp.content.decode('utf-8'))

Expand Down

0 comments on commit 13276b6

Please sign in to comment.