mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-05-07 03:53:56 +00:00
Wait 15 seconds + Clean up
This commit is contained in:
parent
faedf27a37
commit
a11a6cba65
7
twoot.py
7
twoot.py
@ -981,11 +981,6 @@ def main(argv):
|
|||||||
# Post toot
|
# Post toot
|
||||||
toot = {}
|
toot = {}
|
||||||
try:
|
try:
|
||||||
# mastodon = Mastodon(
|
|
||||||
# access_token=TOML['config']['mastodon_user'] + '.secret',
|
|
||||||
# api_base_url='https://' + TOML['config']['mastodon_instance']
|
|
||||||
# )
|
|
||||||
|
|
||||||
if len(media_ids) == 0:
|
if len(media_ids) == 0:
|
||||||
toot = mastodon.status_post(tweet['tweet_text'])
|
toot = mastodon.status_post(tweet['tweet_text'])
|
||||||
else:
|
else:
|
||||||
@ -995,7 +990,7 @@ def main(argv):
|
|||||||
# Assuming this is an:
|
# Assuming this is an:
|
||||||
# ERROR ('Mastodon API returned error', 422, 'Unprocessable Entity', 'Cannot attach files that have not finished processing. Try again in a moment!')
|
# ERROR ('Mastodon API returned error', 422, 'Unprocessable Entity', 'Cannot attach files that have not finished processing. Try again in a moment!')
|
||||||
logging.warning('Mastodon API Error 422: Cannot attach files that have not finished processing. Waiting 15 seconds and retrying.')
|
logging.warning('Mastodon API Error 422: Cannot attach files that have not finished processing. Waiting 15 seconds and retrying.')
|
||||||
# Wait 10 seconds
|
# Wait 15 seconds
|
||||||
time.sleep(15)
|
time.sleep(15)
|
||||||
# retry posting
|
# retry posting
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user