From 60bcc061dc4bd837604e435f03b8c62d33412540 Mon Sep 17 00:00:00 2001 From: Zhuoyun Wei Date: Sat, 29 Jul 2023 22:14:28 -0700 Subject: [PATCH] fix: add media type to toot-converted tweet --- ash.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ash.py b/ash.py index 769358e..4417bc4 100644 --- a/ash.py +++ b/ash.py @@ -80,6 +80,7 @@ def toot_to_tweet(status: dict) -> dict: } media = [ { + 'type': att.get('type'), 'media_url_https': att['url'], 'description': att['description'] } @@ -447,8 +448,8 @@ def get_tweet(tweet_id, ext): videos.append({ 'url': media_url, }) - # type is photo - elif m.get('type') == 'photo': + # type is photo (tweet) or image (toot) + elif m.get('type') in ('photo', 'image'): media_url = m['media_url_https'] if not _is_external_tweet: media_url = replace_media_url(media_url)