Skip to content

Commit

Permalink
fix: some video varant bitrate is str
Browse files Browse the repository at this point in the history
  • Loading branch information
wzyboy committed Aug 19, 2023
1 parent 831eda7 commit 6ffc8ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ash.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def get_tweet(tweet_id, ext):
# type is video
if m.get('type') == 'video':
variants = m['video_info']['variants']
hq_variant = max(variants, key=lambda v: v.get('bitrate', -1))
hq_variant = max(variants, key=lambda v: int(v.get('bitrate', -1)))
media_url = hq_variant['url']
if not _is_external_tweet:
media_url = replace_media_url(media_url)
Expand Down

0 comments on commit 6ffc8ee

Please sign in to comment.