Added missing mime_type argument to call to media-post()

This commit is contained in:
JC François 2019-09-17 13:44:03 +00:00
parent a24f43dbfa
commit 2c0157ad44

View File

@ -314,11 +314,9 @@ def main(argv):
# Download picture
media = requests.get(photo)
mime_type = media.headers['content-type']
# Upload picture to Mastodon instance
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'])
except MastodonAPIError: # Media cannot be uploaded (invalid format, dead link, etc.)
pass