Skip to content

Commit

Permalink
[CI] auto update yt_dlp to upstream commit 2037a6414f81db8080ca724dca…
Browse files Browse the repository at this point in the history
…506fde91974c5d
  • Loading branch information
github-actions[bot] committed Dec 13, 2024
1 parent 7fa54ab commit 6210035
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 16 deletions.
5 changes: 3 additions & 2 deletions lib/yt_dlp/extractor/brightcove.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
update_url_query,
url_or_none,
)
from ..utils.traversal import traverse_obj


class BrightcoveLegacyIE(InfoExtractor):
Expand Down Expand Up @@ -935,8 +936,8 @@ def extract_policy_key():

if content_type == 'playlist':
return self.playlist_result(
[self._parse_brightcove_metadata(vid, vid.get('id'), headers)
for vid in json_data.get('videos', []) if vid.get('id')],
(self._parse_brightcove_metadata(vid, vid['id'], headers)
for vid in traverse_obj(json_data, ('videos', lambda _, v: v['id']))),
json_data.get('id'), json_data.get('name'),
json_data.get('description'))

Expand Down
2 changes: 1 addition & 1 deletion lib/yt_dlp/extractor/dvtv.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def _real_extract(self, url):
items = re.findall(r'(?s)playlist\.push\(({.+?})\);', webpage)
if items:
return self.playlist_result(
[self._parse_video_metadata(i, video_id, timestamp) for i in items],
(self._parse_video_metadata(i, video_id, timestamp) for i in items),
video_id, self._html_search_meta('twitter:title', webpage))

item = self._search_regex(
Expand Down
2 changes: 1 addition & 1 deletion lib/yt_dlp/extractor/nytimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def _real_extract(self, url):
if media_ids:
media_ids.append(lead_video_id)
return self.playlist_result(
[self._extract_video(media_id) for media_id in media_ids], page_id, title, description)
map(self._extract_video, media_ids), page_id, title, description)

return {
**self._extract_video(lead_video_id),
Expand Down
2 changes: 1 addition & 1 deletion lib/yt_dlp/extractor/vidyard.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,5 +421,5 @@ def _real_extract(self, url):
return self._process_video_json(video_json['chapters'][0], video_id)

return self.playlist_result(
[self._process_video_json(chapter, video_id) for chapter in video_json['chapters']],
(self._process_video_json(chapter, video_id) for chapter in video_json['chapters']),
str(video_json['playerUuid']), video_json.get('name'))
16 changes: 9 additions & 7 deletions lib/yt_dlp/extractor/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -3127,9 +3127,9 @@ def _parse_sig_js(self, jscode):
# ;N&&(N=sig(decodeURIComponent(N)),J.set(R,encodeURIComponent(N)));return J};
# {var H=u,k=f.sp,v=sig(decodeURIComponent(f.s));H.set(k,encodeURIComponent(v))}
funcname = self._search_regex(
(r'\b(?P<var>[a-zA-Z0-9$]+)&&\((?P=var)=(?P<sig>[a-zA-Z0-9$]{2,})\(decodeURIComponent\((?P=var)\)\)',
r'(?P<sig>[a-zA-Z0-9$]+)\s*=\s*function\(\s*(?P<arg>[a-zA-Z0-9$]+)\s*\)\s*{\s*(?P=arg)\s*=\s*(?P=arg)\.split\(\s*""\s*\)\s*;\s*[^}]+;\s*return\s+(?P=arg)\.join\(\s*""\s*\)',
r'(?:\b|[^a-zA-Z0-9$])(?P<sig>[a-zA-Z0-9$]{2,})\s*=\s*function\(\s*a\s*\)\s*{\s*a\s*=\s*a\.split\(\s*""\s*\)(?:;[a-zA-Z0-9$]{2}\.[a-zA-Z0-9$]{2}\(a,\d+\))?',
(r'\b(?P<var>[a-zA-Z0-9_$]+)&&\((?P=var)=(?P<sig>[a-zA-Z0-9_$]{2,})\(decodeURIComponent\((?P=var)\)\)',
r'(?P<sig>[a-zA-Z0-9_$]+)\s*=\s*function\(\s*(?P<arg>[a-zA-Z0-9_$]+)\s*\)\s*{\s*(?P=arg)\s*=\s*(?P=arg)\.split\(\s*""\s*\)\s*;\s*[^}]+;\s*return\s+(?P=arg)\.join\(\s*""\s*\)',
r'(?:\b|[^a-zA-Z0-9_$])(?P<sig>[a-zA-Z0-9_$]{2,})\s*=\s*function\(\s*a\s*\)\s*{\s*a\s*=\s*a\.split\(\s*""\s*\)(?:;[a-zA-Z0-9_$]{2}\.[a-zA-Z0-9_$]{2}\(a,\d+\))?',
# Old patterns
r'\b[cs]\s*&&\s*[adf]\.set\([^,]+\s*,\s*encodeURIComponent\s*\(\s*(?P<sig>[a-zA-Z0-9$]+)\(',
r'\b[a-zA-Z0-9]+\s*&&\s*[a-zA-Z0-9]+\.set\([^,]+\s*,\s*encodeURIComponent\s*\(\s*(?P<sig>[a-zA-Z0-9$]+)\(',
Expand Down Expand Up @@ -4067,10 +4067,12 @@ def build_fragments(f):
if height:
res_qualities[height] = quality

display_name = audio_track.get('displayName') or ''
is_original = 'original' in display_name.lower()
is_descriptive = 'descriptive' in display_name.lower()
is_default = audio_track.get('audioIsDefault')
is_descriptive = 'descriptive' in (audio_track.get('displayName') or '').lower()
language_code = audio_track.get('id', '').split('.')[0]
if language_code and is_default:
if language_code and (is_original or (is_default and not original_language)):
original_language = language_code

# FORMAT_STREAM_TYPE_OTF(otf=1) requires downloading the init fragment
Expand Down Expand Up @@ -4151,7 +4153,7 @@ def build_fragments(f):
'filesize': int_or_none(fmt.get('contentLength')),
'format_id': f'{itag}{"-drc" if fmt.get("isDrc") else ""}',
'format_note': join_nonempty(
join_nonempty(audio_track.get('displayName'), is_default and ' (default)', delim=''),
join_nonempty(display_name, is_default and ' (default)', delim=''),
name, fmt.get('isDrc') and 'DRC',
try_get(fmt, lambda x: x['projectionType'].replace('RECTANGULAR', '').lower()),
try_get(fmt, lambda x: x['spatialAudioType'].replace('SPATIAL_AUDIO_TYPE_', '').lower()),
Expand All @@ -4170,7 +4172,7 @@ def build_fragments(f):
'url': fmt_url,
'width': int_or_none(fmt.get('width')),
'language': join_nonempty(language_code, 'desc' if is_descriptive else '') or None,
'language_preference': PREFERRED_LANG_VALUE if is_default else -10 if is_descriptive else -1,
'language_preference': PREFERRED_LANG_VALUE if is_original else 5 if is_default else -10 if is_descriptive else -1,
# Strictly de-prioritize broken, damaged and 3gp formats
'preference': -20 if is_broken else -10 if is_damaged else -2 if itag == '17' else None,
}
Expand Down
6 changes: 3 additions & 3 deletions lib/yt_dlp/version.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Autogenerated by devscripts/update-version.py

__version__ = '2024.12.06'
__version__ = '2024.12.13'

RELEASE_GIT_HEAD = '4bd2655398aed450456197a6767639114a24eac2'
RELEASE_GIT_HEAD = '54216696261bc07cacd9a837c501d9e0b7fed09e'

VARIANT = None

Expand All @@ -12,4 +12,4 @@

ORIGIN = 'yt-dlp/yt-dlp'

_pkg_version = '2024.12.06'
_pkg_version = '2024.12.13'
2 changes: 1 addition & 1 deletion lib/yt_dlp_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f6c73aad5f1a67544bea137ebd9d1e22e0e56567
2037a6414f81db8080ca724dca506fde91974c5d

0 comments on commit 6210035

Please sign in to comment.