From 31a4b0a6e254315abc8fa7e2ec6d24ed2506e58f Mon Sep 17 00:00:00 2001 From: spla Date: Fri, 15 Jul 2022 20:39:10 +0200 Subject: [PATCH] Fix #3, not publishing attached images --- mastotuit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mastotuit.py b/mastotuit.py index 7629acc..094a710 100644 --- a/mastotuit.py +++ b/mastotuit.py @@ -422,16 +422,16 @@ if __name__ == '__main__': is_reply = True tweet_id = get_tweet_id(reply_id) - if len(entry.links) >= 2: + if "media_content" in entry: with_images = True images_list = [] - images = len(entry.links) - 1 + images = len(entry.media_content) i = 0 while i < images: - image_url = entry.links[i+1].href + image_url = entry.media_content[i]['url'] image_filename = write_image(image_url) images_list.append(image_filename) i += 1