|
|
@ -818,12 +818,17 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
|
|
|
|
renderer, ('thumbnailOverlays', ..., 'thumbnailOverlayTimeStatusRenderer', 'style'), get_all=False, expected_type=str)
|
|
|
|
renderer, ('thumbnailOverlays', ..., 'thumbnailOverlayTimeStatusRenderer', 'style'), get_all=False, expected_type=str)
|
|
|
|
badges = self._extract_badges(renderer)
|
|
|
|
badges = self._extract_badges(renderer)
|
|
|
|
thumbnails = self._extract_thumbnails(renderer, 'thumbnail')
|
|
|
|
thumbnails = self._extract_thumbnails(renderer, 'thumbnail')
|
|
|
|
|
|
|
|
navigation_url = urljoin('https://www.youtube.com/', traverse_obj(
|
|
|
|
|
|
|
|
renderer, ('navigationEndpoint', 'commandMetadata', 'webCommandMetadata', 'url'), expected_type=str))
|
|
|
|
|
|
|
|
url = f'https://www.youtube.com/watch?v={video_id}'
|
|
|
|
|
|
|
|
if overlay_style == 'SHORTS' or (navigation_url and '/shorts/' in navigation_url):
|
|
|
|
|
|
|
|
url = f'https://www.youtube.com/shorts/{video_id}'
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
'_type': 'url',
|
|
|
|
'_type': 'url',
|
|
|
|
'ie_key': YoutubeIE.ie_key(),
|
|
|
|
'ie_key': YoutubeIE.ie_key(),
|
|
|
|
'id': video_id,
|
|
|
|
'id': video_id,
|
|
|
|
'url': f'https://www.youtube.com/watch?v={video_id}',
|
|
|
|
'url': url,
|
|
|
|
'title': title,
|
|
|
|
'title': title,
|
|
|
|
'description': description,
|
|
|
|
'description': description,
|
|
|
|
'duration': duration,
|
|
|
|
'duration': duration,
|
|
|
|