projects
/
tweepy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b887148
)
increase max image size for gif
author
Yechiel K
<contact@yechiel.me>
Sun, 1 Mar 2020 20:27:47 +0000
(15:27 -0500)
committer
Yechiel K
<contact@yechiel.me>
Sun, 1 Mar 2020 20:38:05 +0000
(15:38 -0500)
tweepy/api.py
patch
|
blob
|
blame
|
history
diff --git
a/tweepy/api.py
b/tweepy/api.py
index 0ceedcae086d1e84cda72ab068787a4922d6d6e1..aa6872f472ca2c2c288dc43f12ce0acbbb3b0f79 100644
(file)
--- a/
tweepy/api.py
+++ b/
tweepy/api.py
@@
-219,7
+219,14
@@
class API(object):
:allowed_param:
"""
f = kwargs.pop('file', None)
- headers, post_data = API._pack_image(filename, 4883,
+
+ file_type = imghdr.what(filename)
+ if file_type == 'gif':
+ max_size = 15360
+ else:
+ max_size = 4883
+
+ headers, post_data = API._pack_image(filename, max_size,
form_field='media', f=f)
kwargs.update({'headers': headers, 'post_data': post_data})