File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ def http_to_file(http):
216216 return data_file
217217
218218
219- def parse_media_file (passed_media ):
219+ def parse_media_file (passed_media , media_category = None ):
220220 """ Parses a media file and attempts to return a file-like object and
221221 information about the media file.
222222
@@ -265,7 +265,8 @@ def parse_media_file(passed_media):
265265 media_type = mimetypes .guess_type (os .path .basename (filename ))[0 ]
266266 if media_type is not None :
267267 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.' })
269270 elif media_type in video_formats and file_size > 15 * 1048576 :
270271 raise TwitterError ({'message' : 'Videos must be less than 15MB.' })
271272 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