Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/globo.py (Python)

Code before:
                'operationName': 'getVideoView',
                'variables': json.dumps({'videoId': video_id}),
                'query': self._VIDEO_VIEW,
            }, headers={
                'content-type': 'application/json',
                'x-platform-id': 'web',
                'x-device-id': 'desktop',
                'x-client-version': '2024.12-5',
            })['data']['video']

        formats = []
        video = self._download_json(
            'https://playback.video.globo.com/v4/video-session', video_id,
            f'Downloading resource info for {video_id}',
            headers={'Content-Type': 'application/json'},
            data=json.dumps(filter_dict({
                'player_type': 'mirakulo_8k_hdr',
                'video_id': video_id,
                'quality': 'max',
                'content_protection': 'widevine',
                'vsid': f'{uuid.uuid4()}',
                'consumption': 'streaming',
                'capabilities': {'low_latency': True},
                'tz': '-03:00',
                'Authorization': try_get(self._get_cookies('https://globo.com'),
                                         lambda x: f'Bearer {x["GLBID"].value}') or '',
                'version': 1,
            })).encode())

        if traverse_obj(video, ('resource', 'drm_protection_enabled', {bool})):
            self.report_drm(video_id)

        main_source = video['sources'][0]

        # 4k streams are exclusively outputted in dash, so we need to filter these out
        if determine_ext(main_source['url']) == 'mpd':
            formats, subtitles = self._extract_mpd_formats_and_subtitles(main_source['url'], video_id, mpd_id='dash')
        else:
            formats, subtitles = self._extract_m3u8_formats_and_subtitles(
                main_source['url'], video_id, 'mp4', m3u8_id='hls')
        self._merge_subtitles(traverse_obj(main_source, ('text', ..., {
            'url': ('subtitle', 'srt', 'url', {url_or_none}),
        }, all, {subs_list_to_dict(lang='en')})), target=subtitles)

        return {
            'id': video_id,
            **traverse_obj(info, {
                'title': ('headline', {str}),
                'duration': ('duration', {float_or_none(scale=1000)}),
                'uploader': ('title', 'headline', {str}),
                'uploader_id': ('title', 'originProgramId', {str_or_none}),

Review comment (suggestion):
```suggestion
                                         lambda x: f'Bearer {x["GLBID"].value}'),
```

Code after:
                'operationName': 'getVideoView',
                'variables': json.dumps({'videoId': video_id}),
                'query': self._VIDEO_VIEW,
            }, headers={
                'content-type': 'application/json',
                'x-platform-id': 'web',
                'x-device-id': 'desktop',
                'x-client-version': '2024.12-5',
            })['data']['video']

        formats = []
        video = self._download_json(
            'https://playback.video.globo.com/v4/video-session', video_id,
            f'Downloading resource info for {video_id}',
            headers={'Content-Type': 'application/json'},
            data=json.dumps(filter_dict({
                'player_type': 'mirakulo_8k_hdr',
                'video_id': video_id,
                'quality': 'max',
                'content_protection': 'widevine',
                'vsid': f'{uuid.uuid4()}',
                'consumption': 'streaming',
                'capabilities': {'low_latency': True},
                'tz': '-03:00',
                'Authorization': try_get(self._get_cookies('https://globo.com'),
                                         lambda x: f'Bearer {x["GLBID"].value}'),
                'version': 1,
            })).encode())

        if traverse_obj(video, ('resource', 'drm_protection_enabled', {bool})):
            self.report_drm(video_id)

        main_source = video['sources'][0]

        # 4k streams are exclusively outputted in dash, so we need to filter these out
        if determine_ext(main_source['url']) == 'mpd':
            formats, subtitles = self._extract_mpd_formats_and_subtitles(main_source['url'], video_id, mpd_id='dash')
        else:
            formats, subtitles = self._extract_m3u8_formats_and_subtitles(
                main_source['url'], video_id, 'mp4', m3u8_id='hls')
        self._merge_subtitles(traverse_obj(main_source, ('text', ..., {
            'url': ('subtitle', 'srt', 'url', {url_or_none}),
        }, all, {subs_list_to_dict(lang='en')})), target=subtitles)

        return {
            'id': video_id,
            **traverse_obj(info, {
                'title': ('headline', {str}),
                'duration': ('duration', {float_or_none(scale=1000)}),
                'uploader': ('title', 'headline', {str}),
                'uploader_id': ('title', 'originProgramId', {str_or_none}),