mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-04 12:07:12 +01:00
parent
75689fe59b
commit
a33c0d9c5d
@ -345,6 +345,7 @@ def _extract_info(self, info):
|
|||||||
'timestamp': parse_iso8601(info.get('recorded_at')),
|
'timestamp': parse_iso8601(info.get('recorded_at')),
|
||||||
'view_count': int_or_none(info.get('views')),
|
'view_count': int_or_none(info.get('views')),
|
||||||
'is_live': is_live,
|
'is_live': is_live,
|
||||||
|
'was_live': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
def _extract_moments(self, info, item_id):
|
def _extract_moments(self, info, item_id):
|
||||||
@ -368,7 +369,12 @@ def _extract_info_gql(self, info, item_id):
|
|||||||
if vod_id[0] != 'v':
|
if vod_id[0] != 'v':
|
||||||
vod_id = 'v%s' % vod_id
|
vod_id = 'v%s' % vod_id
|
||||||
thumbnail = url_or_none(info.get('previewThumbnailURL'))
|
thumbnail = url_or_none(info.get('previewThumbnailURL'))
|
||||||
|
is_live = None
|
||||||
if thumbnail:
|
if thumbnail:
|
||||||
|
if thumbnail.endswith('/404_processing_{width}x{height}.png'):
|
||||||
|
is_live, thumbnail = True, None
|
||||||
|
else:
|
||||||
|
is_live = False
|
||||||
for p in ('width', 'height'):
|
for p in ('width', 'height'):
|
||||||
thumbnail = thumbnail.replace('{%s}' % p, '0')
|
thumbnail = thumbnail.replace('{%s}' % p, '0')
|
||||||
|
|
||||||
@ -383,6 +389,8 @@ def _extract_info_gql(self, info, item_id):
|
|||||||
'timestamp': unified_timestamp(info.get('publishedAt')),
|
'timestamp': unified_timestamp(info.get('publishedAt')),
|
||||||
'view_count': int_or_none(info.get('viewCount')),
|
'view_count': int_or_none(info.get('viewCount')),
|
||||||
'chapters': list(self._extract_moments(info, item_id)),
|
'chapters': list(self._extract_moments(info, item_id)),
|
||||||
|
'is_live': is_live,
|
||||||
|
'was_live': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
Loading…
Reference in New Issue
Block a user