From 355b496d1ab08d55b0ce5be941927775d61e1f07 Mon Sep 17 00:00:00 2001 From: Elad Alfassa Date: Sun, 3 Apr 2016 18:49:10 +0300 Subject: [PATCH] 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. --- tweepy/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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( -- 2.25.1