projects
/
tweepy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a71938
)
Added getting file_type by filestream
author
keatonconrad
<keaton.conrad@gmail.com>
Wed, 16 Dec 2020 04:15:59 +0000
(22:15 -0600)
committer
keatonconrad
<keaton.conrad@gmail.com>
Wed, 16 Dec 2020 04:15:59 +0000
(22:15 -0600)
tweepy/api.py
patch
|
blob
|
blame
|
history
diff --git
a/tweepy/api.py
b/tweepy/api.py
index 4a2599c76ff3c653b200271c81d0b9912d0d81d3..1bb16e0ad1f53be96d3525144f7cda98cbe6f825 100644
(file)
--- a/
tweepy/api.py
+++ b/
tweepy/api.py
@@
-1418,7
+1418,7
@@
class API(object):
# image must be gif, jpeg, png, webp
if not file_type:
- file_type = imghdr.what(filename) or mimetypes.guess_type(filename)[0]
+ file_type = imghdr.what(filename
, h=f
) or mimetypes.guess_type(filename)[0]
if file_type is None:
raise TweepError('Could not determine file type')
if file_type in ['gif', 'jpeg', 'png', 'webp']: