Compare commits

...

2 Commits

Author SHA1 Message Date
blueowl04
85065d9d3c
Merge 2bbe273a81b76d9ddd4df8bac7372db6ec1666a0 into 2b4fbfce25902d557b86b003cf48f738129efce4 2025-03-26 07:21:53 +00:00
Jiří Klimeš
2bbe273a81 [youtube] add published_time for --flat_playlist JSON
It is very desirable to have information about video age too.

Example:
  youtube-dl --flat-playlist -j ytsearch10:"egg recipe"
2022-08-29 22:16:11 +02:00

View File

@ -451,6 +451,8 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
renderer,
(lambda x: x['ownerText']['runs'][0]['text'],
lambda x: x['shortBylineText']['runs'][0]['text']), compat_str)
published_time = try_get(
renderer, lambda x: x['publishedTimeText']['simpleText'], compat_str) or ''
return {
'_type': 'url',
'ie_key': YoutubeIE.ie_key(),
@ -461,6 +463,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
'duration': duration,
'view_count': view_count,
'uploader': uploader,
'published_time': published_time,
}
@staticmethod