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