Skip to content

Commit

Permalink
[cleanup] Make more playlist entries lazy (yt-dlp#11763)
Browse files Browse the repository at this point in the history
Authored by: seproDev
  • Loading branch information
seproDev authored Dec 13, 2024
1 parent dc3c4fd commit 5421669
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions 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 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 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 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'))

0 comments on commit 5421669

Please sign in to comment.