Fix file size limit for media_upload
authorElad Alfassa <elad@fedoraproject.org>
Sun, 3 Apr 2016 15:49:10 +0000 (18:49 +0300)
committerElad Alfassa <elad@fedoraproject.org>
Sun, 3 Apr 2016 15:49:10 +0000 (18:49 +0300)
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

index b925da3884a84cc9efee4f58850701dc2ac96592..2fd6bee33b7d6c1e7161fd327090fbf792bae0a9 100644 (file)
@@ -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(