File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ def http_to_file(http):
216
216
return data_file
217
217
218
218
219
- def parse_media_file (passed_media ):
219
+ def parse_media_file (passed_media , media_category = None ):
220
220
""" Parses a media file and attempts to return a file-like object and
221
221
information about the media file.
222
222
@@ -265,7 +265,8 @@ def parse_media_file(passed_media):
265
265
media_type = mimetypes .guess_type (os .path .basename (filename ))[0 ]
266
266
if media_type is not None :
267
267
if media_type in img_formats and file_size > 5 * 1048576 :
268
- raise TwitterError ({'message' : 'Images must be less than 5MB.' })
268
+ if media_category is not 'tweet_gif' :
269
+ raise TwitterError ({'message' : 'Images must be less than 5MB.' })
269
270
elif media_type in video_formats and file_size > 15 * 1048576 :
270
271
raise TwitterError ({'message' : 'Videos must be less than 15MB.' })
271
272
elif media_type not in img_formats and media_type not in video_formats :
You can’t perform that action at this time.
0 commit comments