Compare commits

...

5 Commits

Author SHA1 Message Date
slipinthedove
9ac6340cc2 don't specify a default language for subtitles 2024-12-19 23:06:59 -03:00
slipinthedove
fb3ef7fc85 mistypo on cookie resolve - happens 2024-12-19 22:44:17 -03:00
slipinthedove
a6e6c3f02d mistypo on domain resolving 2024-12-19 22:40:12 -03:00
slipinthedove
cec240eb2d use authorization for video-session if cookies are specified 2024-12-19 22:35:17 -03:00
slipinthedove
4c63497cc6 actually fix subs to dict; exclude globoplay from globoarticle regex 2024-12-19 22:13:29 -03:00

View File

@ -6,6 +6,7 @@ from ..utils import (
float_or_none,
orderedSet,
str_or_none,
try_get,
)
from ..utils.traversal import subs_list_to_dict, traverse_obj
@ -85,6 +86,8 @@ class GloboIE(InfoExtractor):
'content_protection': 'widevine',
'vsid': '2938bc7c-9376-d4b7-ee91-ce46dbbf9f4d',
'tz': '-03:00',
'Authorization': try_get(self._get_cookies('https://globo.com'),
lambda x: f'Bearer {x["GLBID"].value}') or '',
'version': 1,
}).encode())
@ -96,8 +99,8 @@ class GloboIE(InfoExtractor):
formats, subtitles = self._extract_m3u8_formats_and_subtitles(
main_source['url'], video_id, 'mp4', entry_protocol='m3u8_native', m3u8_id='hls', fatal=False)
self._merge_subtitles(traverse_obj(main_source, ('text', ..., {
'url': ('subtitle', 'srt', 'url', {str}),
}, all, {subs_list_to_dict(lang='por')})))
'url': ('subtitle', 'srt', 'url', {str_or_none}),
}, all, {subs_list_to_dict})), target=subtitles)
return {
'id': video_id,
@ -113,7 +116,7 @@ class GloboIE(InfoExtractor):
class GloboArticleIE(InfoExtractor):
_VALID_URL = r'https?://.+?\.globo\.com/(?:[^/]+/)*(?P<id>[^/.]+)(?:\.html)?'
_VALID_URL = r'https?://(?!globoplay).+?\.globo\.com/(?:[^/]+/)*(?P<id>[^/.]+)(?:\.html)?'
_VIDEOID_REGEXES = [
r'\bdata-video-id=["\'](\d{7,})["\']',