mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-07-17 18:58:35 +00:00
Use traverse_obj
to check url before adding to subtitles
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
This commit is contained in:
parent
e17f38f5ac
commit
ec64564c2f
@ -136,8 +136,8 @@ def _real_extract(self, url):
|
||||
'url': subs['url'],
|
||||
})
|
||||
|
||||
for current_chat in video_info.get('chats'):
|
||||
subtitles.setdefault('live_chat', []).append({'url': url_or_none(current_chat['url'])})
|
||||
for live_chat_url in traverse_obj(video_info, ('chats', ..., 'url', {url_or_none})):
|
||||
subtitles.setdefault('live_chat', []).append({'url': live_chat_url})
|
||||
|
||||
return {
|
||||
**traverse_obj(video_info, {
|
||||
|
Loading…
Reference in New Issue
Block a user