From d69dbd719424c1bb66caa27200c8a9a67bd1cb22 Mon Sep 17 00:00:00 2001 From: lluni Date: Mon, 8 Jan 2024 15:21:29 +0100 Subject: [PATCH] Wait a minute after uploading a video to give Mastodon time to process it --- script.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script.py b/script.py index a1b241f..8506c73 100644 --- a/script.py +++ b/script.py @@ -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")