mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-07-20 12:18:29 +00:00
Inline duration
, timestamp
and title
This commit is contained in:
parent
dc8d1c6b6c
commit
93a2278b99
@ -119,10 +119,6 @@ def _real_extract(self, url):
|
|||||||
video_info = self._call_api(region, video_id, 'data', note='Trying fallback', fatal=True)
|
video_info = self._call_api(region, video_id, 'data', note='Trying fallback', fatal=True)
|
||||||
video_extra = {}
|
video_extra = {}
|
||||||
|
|
||||||
duration = int_or_none(video_info.get('duration'), 1000)
|
|
||||||
title = video_info.get('name')
|
|
||||||
upload_date = video_info.get('created')
|
|
||||||
|
|
||||||
formats = traverse_obj(video_info, ('extStreams', ..., {
|
formats = traverse_obj(video_info, ('extStreams', ..., {
|
||||||
'url': ('streamUrl', {url_or_none}),
|
'url': ('streamUrl', {url_or_none}),
|
||||||
'container': ('contentType', {mimetype2ext}),
|
'container': ('contentType', {mimetype2ext}),
|
||||||
@ -144,12 +140,14 @@ def _real_extract(self, url):
|
|||||||
subtitles.setdefault('live_chat', []).append({'url': url_or_none(current_chat['url'])})
|
subtitles.setdefault('live_chat', []).append({'url': url_or_none(current_chat['url'])})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'duration': duration,
|
**traverse_obj(video_info, {
|
||||||
|
'title': ('name', {str}),
|
||||||
|
'timestamp': ('created', {parse_iso8601}),
|
||||||
|
'duration': ('duration', {int_or_none(scale=1000)}),
|
||||||
|
}),
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'timestamp': parse_iso8601(upload_date),
|
|
||||||
'subtitles': subtitles,
|
'subtitles': subtitles,
|
||||||
'title': title,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user