Skip to content

Commit

Permalink
fix: add media type to toot-converted tweet
Browse files Browse the repository at this point in the history
  • Loading branch information
wzyboy committed Jul 30, 2023
1 parent fca8643 commit 60bcc06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ash.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def toot_to_tweet(status: dict) -> dict:
}
media = [
{
'type': att.get('type'),
'media_url_https': att['url'],
'description': att['description']
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 60bcc06

Please sign in to comment.