mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 12:01:28 +00:00
[ie/tiktok] Prefer non-bytevc2 formats (#9575)
Closes #9567 Authored by: bashonly
This commit is contained in:
parent
3699eeb67c
commit
63f685f341
|
@ -274,6 +274,7 @@ def audio_meta(url):
|
|||
|
||||
def extract_addr(addr, add_meta={}):
|
||||
parsed_meta, res = parse_url_key(addr.get('url_key', ''))
|
||||
is_bytevc2 = parsed_meta.get('vcodec') == 'bytevc2'
|
||||
if res:
|
||||
known_resolutions.setdefault(res, {}).setdefault('height', int_or_none(addr.get('height')))
|
||||
known_resolutions[res].setdefault('width', int_or_none(addr.get('width')))
|
||||
|
@ -286,8 +287,11 @@ def extract_addr(addr, add_meta={}):
|
|||
'acodec': 'aac',
|
||||
'source_preference': -2 if 'aweme/v1' in url else -1, # Downloads from API might get blocked
|
||||
**add_meta, **parsed_meta,
|
||||
# bytevc2 is bytedance's proprietary (unplayable) video codec
|
||||
'preference': -100 if is_bytevc2 else -1,
|
||||
'format_note': join_nonempty(
|
||||
add_meta.get('format_note'), '(API)' if 'aweme/v1' in url else None, delim=' '),
|
||||
add_meta.get('format_note'), '(API)' if 'aweme/v1' in url else None,
|
||||
'(UNPLAYABLE)' if is_bytevc2 else None, delim=' '),
|
||||
**audio_meta(url),
|
||||
} for url in addr.get('url_list') or []]
|
||||
|
||||
|
|
Loading…
Reference in a new issue