Wait a minute after uploading a video to give Mastodon time to process it

This commit is contained in:
lluni 2024-01-08 15:21:29 +01:00
parent 83c87c310d
commit d69dbd7194
Signed by: lluni
GPG key ID: ACEEB468BC325D35

View file

@ -1,5 +1,6 @@
"""Main script to toot a new post"""
import time
from os import getenv, remove
from os.path import getsize
@ -71,6 +72,7 @@ for submission in reddit.subreddit(str(getenv("REDDIT_SUBREDDIT"))).top(time_fil
mastodon.status_post(status_text, visibility="unlisted")
else:
media = mastodon.media_post(filename)
time.sleep(60.0)
status_text = submission.title + "\n\ngeposted von u/" + submission.author.name + "\nhttps://www.reddit.com" + submission.permalink
mastodon.status_post(status_text, media_ids=media["id"], visibility="unlisted")