mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-02-10 20:47:50 +01:00
[globo] review fixes
push video_view as a class constant, use traverse_obj where possible and replace the subs metodology to use subs_list_to_dict, etc.
This commit is contained in:
parent
93e715c81e
commit
0f928ed840
1 changed files with 7 additions and 5 deletions
|
@ -89,11 +89,13 @@ class GloboIE(InfoExtractor):
|
||||||
self.report_drm(video_id)
|
self.report_drm(video_id)
|
||||||
|
|
||||||
main_source = video['sources'][0]
|
main_source = video['sources'][0]
|
||||||
resource_url = main_source['url']
|
|
||||||
|
|
||||||
fmts, subtitles = self._extract_m3u8_formats_and_subtitles(
|
formats, subtitles = self._extract_m3u8_formats_and_subtitles(
|
||||||
resource_url, video_id, 'mp4', entry_protocol='m3u8_native', m3u8_id='hls', fatal=False)
|
main_source['url'], video_id, 'mp4', entry_protocol='m3u8_native', m3u8_id='hls', fatal=False)
|
||||||
formats.extend(fmts)
|
self._merge_subtitles(traverse_obj(main_source, ('text', ..., {
|
||||||
|
'id': 'por',
|
||||||
|
'url': ('subtitle', 'srt', 'url', {str}),
|
||||||
|
}, all, {subs_list_to_dict(lang='por')})))
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
@ -104,7 +106,7 @@ class GloboIE(InfoExtractor):
|
||||||
'uploader_id': ('title', 'originProgramId', {str_or_none}),
|
'uploader_id': ('title', 'originProgramId', {str_or_none}),
|
||||||
}),
|
}),
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'subtitles': subs_list_to_dict(traverse_obj(main_source, ('text', {dict.items}))),
|
'subtitles': subtitles,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue