Skip to content

Commit

Permalink
fix: toot video
Browse files Browse the repository at this point in the history
  • Loading branch information
wzyboy committed Jul 30, 2023
1 parent 60bcc06 commit 3da30c7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ash.py
Expand Up @@ -80,7 +80,7 @@ def toot_to_tweet(status: dict) -> dict:
}
media = [
{
'type': att.get('type'),
'type': 'toot-' + att.get('type', ''),
'media_url_https': att['url'],
'description': att['description']
}
Expand Down Expand Up @@ -448,8 +448,12 @@ def get_tweet(tweet_id, ext):
videos.append({
'url': media_url,
})
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', 'image'):
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 3da30c7

Please sign in to comment.