[twitter] small fix

This commit is contained in:
Mort Yao 2022-10-09 00:37:48 +02:00
parent 81b1f06a05
commit 4746af3462
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251

View File

@ -84,7 +84,7 @@ def twitter_download(url, output_dir='.', merge=True, info_only=False, **kwargs)
if 'video_info' in medium: if 'video_info' in medium:
variants = medium['video_info']['variants'] variants = medium['video_info']['variants']
variants = sorted(variants, key=lambda kv: kv.get('bitrate', 0)) variants = sorted(variants, key=lambda kv: kv.get('bitrate', 0))
title = item_id + '_' + variants[-1]['url'].split('/')[-1].split('?')[0] title = item_id + '_' + variants[-1]['url'].split('/')[-1].split('?')[0].split('.')[0]
urls = [ variants[-1]['url'] ] urls = [ variants[-1]['url'] ]
size = urls_size(urls) size = urls_size(urls)
mime, ext = variants[-1]['content_type'], 'mp4' mime, ext = variants[-1]['content_type'], 'mp4'