From 8faa2bafac4b79e7e60b569b4bb8f89144940c78 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 12 Dec 2023 09:07:36 +0100 Subject: [PATCH] Apparently, media ids are strings Nevermind that they are returned as integers from the same APIs, they need to be passed as strings. --- postgresqleu/util/messaging/twitter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgresqleu/util/messaging/twitter.py b/postgresqleu/util/messaging/twitter.py index a839fc677..d3330a99b 100644 --- a/postgresqleu/util/messaging/twitter.py +++ b/postgresqleu/util/messaging/twitter.py @@ -249,7 +249,7 @@ def post(self, tweet, image=None, replytotweetid=None): if r.status_code != 200: return (None, 'Media upload: {}'.format(r.text)) d['media'] = { - 'media_ids': [r.json()['media_id'], ] + 'media_ids': [str(r.json()['media_id']), ] } while d['text']: