mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-04-12 15:55:57 +00:00
tentative mitigation of error 422
This commit is contained in:
parent
5ecc8bd634
commit
36248dbce1
3
twoot.py
3
twoot.py
@ -952,6 +952,9 @@ def main(argv):
|
|||||||
logging.debug("Uploading video to Mastodon")
|
logging.debug("Uploading video to Mastodon")
|
||||||
media_posted = mastodon.media_post(tweet['video'])
|
media_posted = mastodon.media_post(tweet['video'])
|
||||||
media_ids.append(media_posted['id'])
|
media_ids.append(media_posted['id'])
|
||||||
|
# Possible mitigation for
|
||||||
|
# ERROR ('Mastodon API returned error', 422, 'Unprocessable Entity', 'Cannot attach files that have not finished processing. Try again in a moment!')
|
||||||
|
time.sleep(5)
|
||||||
except (MastodonAPIError, MastodonIllegalArgumentError,
|
except (MastodonAPIError, MastodonIllegalArgumentError,
|
||||||
TypeError): # Media cannot be uploaded (invalid format, dead link, etc.)
|
TypeError): # Media cannot be uploaded (invalid format, dead link, etc.)
|
||||||
logging.debug("Uploading video failed")
|
logging.debug("Uploading video failed")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user