mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-02-25 17:38:43 +00:00
Added missing mime_type argument to call to media-post()
This commit is contained in:
parent
a24f43dbfa
commit
2c0157ad44
4
twoot.py
4
twoot.py
@ -314,11 +314,9 @@ def main(argv):
|
|||||||
# Download picture
|
# Download picture
|
||||||
media = requests.get(photo)
|
media = requests.get(photo)
|
||||||
|
|
||||||
mime_type = media.headers['content-type']
|
|
||||||
|
|
||||||
# Upload picture to Mastodon instance
|
# Upload picture to Mastodon instance
|
||||||
try:
|
try:
|
||||||
media_posted = mastodon.media_post(media.content)
|
media_posted = mastodon.media_post(media.content, mime_type=media.headers['content-type'])
|
||||||
media_ids.append(media_posted['id'])
|
media_ids.append(media_posted['id'])
|
||||||
except MastodonAPIError: # Media cannot be uploaded (invalid format, dead link, etc.)
|
except MastodonAPIError: # Media cannot be uploaded (invalid format, dead link, etc.)
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user