From: Elad Alfassa Date: Sun, 3 Apr 2016 15:49:10 +0000 (+0300) Subject: Fix file size limit for media_upload X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=355b496d1ab08d55b0ce5be941927775d61e1f07;p=tweepy.git Fix file size limit for media_upload According to https://dev.twitter.com/rest/reference/post/media/upload the limit of this endpoint is 5MB (which is 4883KiB) per file. --- diff --git a/tweepy/api.py b/tweepy/api.py index b925da3..2fd6bee 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -198,7 +198,7 @@ class API(object): :allowed_param: """ f = kwargs.pop('file', None) - headers, post_data = API._pack_image(filename, 3072, form_field='media', f=f) + headers, post_data = API._pack_image(filename, 4883, form_field='media', f=f) kwargs.update({'headers': headers, 'post_data': post_data}) return bind_api(