Skip to content

Commit

Permalink
Merge pull request #11 from wzyboy/fix/toot-media
Browse files Browse the repository at this point in the history
fix: media in toots
  • Loading branch information
wzyboy committed Jul 30, 2023
2 parents fca8643 + 3da30c7 commit b7a4cec
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ash.py
Expand Up @@ -80,6 +80,7 @@ def toot_to_tweet(status: dict) -> dict:
}
media = [
{
'type': 'toot-' + att.get('type', ''),
'media_url_https': att['url'],
'description': att['description']
}
Expand Down Expand Up @@ -447,8 +448,12 @@ def get_tweet(tweet_id, ext):
videos.append({
'url': media_url,
})
# type is photo
elif m.get('type') == 'photo':
elif m.get('type') == 'toot-video':
videos.append({
'url': m['media_url_https']
})
# type is photo (tweet) or image (toot)
elif m.get('type') in ('photo', 'toot-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 b7a4cec

Please sign in to comment.