-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
Apparently, it's not possible to mix photos and videos in a toot, contrary to a tweet. Mastodon API raises an exception in this case when the script try to post such toot.
There is a catch, then a 10s wait, but the script re-do the same, and the same exception is raised again.
I did a temporary "fix" by changing
try:
if len(toot_media)>0:
time.sleep(5)
toot = mastodon_api.status_post(c,
in_reply_to_id=None,
media_ids=toot_media,
sensitive=False,
visibility='unlisted',
spoiler_text=None)
except:
print("10s delay")
time.sleep(10)
toot = mastodon_api.status_post(c,
in_reply_to_id=None,
media_ids=toot_media,
sensitive=False,
visibility='unlisted',
spoiler_text=None)
pass
to
try:
if len(toot_media)>0:
time.sleep(5)
toot = mastodon_api.status_post(c,
in_reply_to_id=None,
media_ids=toot_media,
sensitive=False,
visibility='unlisted',
spoiler_text=None)
except:
print("10s delay")
time.sleep(10)
toot = mastodon_api.status_post(c,
in_reply_to_id=None,
media_ids=[],
sensitive=False,
visibility='unlisted',
spoiler_text=None)
pass
But I guess there is a better way to fix that (I'm very far from being a Python expert…)
Metadata
Metadata
Assignees
Labels
No labels