mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-06-27 17:08:32 +00:00
Use traverse_obj to unpack json data
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
This commit is contained in:
parent
9c4772bc12
commit
59979a0680
@ -50,10 +50,11 @@ def _real_extract(self, url):
|
||||
'id': video_id,
|
||||
'url': 'https://' + self._search_regex(r'redirect\.mp3/(.+)', data['url'], 'video url'),
|
||||
'vcodec': 'none',
|
||||
'thumbnail': thumbnail,
|
||||
'title': title,
|
||||
'creators': creators,
|
||||
'description': description,
|
||||
'duration': duration,
|
||||
'formats': formats,
|
||||
**traverse_obj(data, {
|
||||
'title': ('title', {str}),
|
||||
'description': ('description', {clean_html}),
|
||||
'duration': ('duration', {int_or_none}),
|
||||
'thumbnail': (('image', ('series', 'image')), 'url', {url_or_none}, any),
|
||||
'creators': ('series', 'author', {str}, filter, all, filter),
|
||||
}),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user