Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ie/zaiko] add thumbnails from event pages #8054

Merged
merged 3 commits into from
Sep 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions yt_dlp/extractor/zaiko.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
traverse_obj,
try_call,
unescapeHTML,
url_basename,
url_or_none,
)

Expand Down Expand Up @@ -45,12 +46,14 @@ class ZaikoIE(ZaikoBaseIE):
'uploader_id': '454',
'uploader': 'ZAIKO ZERO',
'release_timestamp': 1583809200,
'thumbnail': r're:https://[a-z0-9]+.cloudfront.net/[a-z0-9_]+/[a-z0-9_]+',
'thumbnail': r're:^https://[\w.-]+/\w+/\w+',
'thumbnails': 'maxcount:2',
'release_date': '20200310',
'categories': ['Tech House'],
'live_status': 'was_live',
},
'params': {'skip_download': 'm3u8'},
'skip': 'Your account does not have tickets to this event',
}]

def _real_extract(self, url):
Expand Down Expand Up @@ -83,6 +86,12 @@ def _real_extract(self, url):
if not formats:
self.raise_no_formats(msg, expected=expected)

thumbnail_urls = [
traverse_obj(player_meta, ('initial_event_info', 'poster_url')),
self._og_search_thumbnail(self._download_webpage(
f'https://zaiko.io/event/{video_id}', video_id, 'Downloading event page', fatal=False) or ''),
]

return {
'id': video_id,
'formats': formats,
Expand All @@ -96,8 +105,8 @@ def _real_extract(self, url):
}),
**traverse_obj(player_meta, ('initial_event_info', {
'alt_title': ('title', {str}),
'thumbnail': ('poster_url', {url_or_none}),
})),
'thumbnails': [{'url': url, 'id': url_basename(url)} for url in thumbnail_urls if url_or_none(url)]
}


Expand Down