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

Commit 13276b6

Browse files
authored
Merge pull request #663 from Bracciata/feature/gifs_over_5mb
Feature: Allow ability to upload gifs in the range of 5MB to 15MB.
2 parents 773bce9 + 56ce285 commit 13276b6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

twitter/api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,10 @@ def _UploadMediaChunkedInit(self,
12881288
parameters['media_type'] = media_type
12891289
parameters['total_bytes'] = file_size
12901290

1291+
# Without this GIF files over 5MB but less than 15MB will fail uploading.
1292+
if media_type == 'image/gif' and file_size > 5242880:
1293+
parameters['media_category'] = 'tweet_gif'
1294+
12911295
resp = self._RequestUrl(url, 'POST', data=parameters)
12921296
data = self._ParseAndCheckTwitter(resp.content.decode('utf-8'))
12931297

0 commit comments

Comments
 (0)