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

Code before:
    def _perform_login(self, username, password):
        self.report_login()
        aws = AwsIdp(ie=self, pool_id='eu-west-1_dViSsKM5Y', client_id='6s1h851s8uplco5h6mqh1jac8m')
        self._id_token, _ = aws.authenticate(username=username, password=password)

    def _real_initialize(self):
        if not self._id_token:
            raise self.raise_login_required(method='password')

    def _real_extract(self, url):
        url, display_id = self._match_valid_url(url).group(0, 'display_id')
        webpage = self._download_webpage(url, display_id)

        # regex pattern to capture JSON-like data starting with {"meta" and ending with }}\n])
        pattern = r'(\{\\"meta.*\\"\}\})\]\]\\n\"]\)'

        # Use _html_search_regex to search for the JSON-like data
        video_data_json = self._html_search_regex(pattern, webpage, '{"meta"...}}')

        # Replace \" with " to make it a valid JSON string
        video_data_json = video_data_json.replace('\\"', '"')

        video_data = self._parse_json(unescapeHTML(video_data_json), display_id)

        info_dict = {
            'title': video_data.get('meta').get('title'),
        }

        video_id = video_data.get('meta').get('uuid')

        api = self._download_json(
            f'https://api.goplay.be/web/v1/videos/long-form/{video_id}',
            video_id, headers={
                'Authorization': f'Bearer {self._id_token}',
                **self.geo_verification_headers(),
            })

        if 'manifestUrls' in api:
            formats, subtitles = self._extract_m3u8_formats_and_subtitles(
                api['manifestUrls']['hls'], video_id, ext='mp4', m3u8_id='HLS')

        else:
            if 'ssai' not in api:
                raise ExtractorError('expecting Google SSAI stream')

            ssai_content_source_id = api['ssai']['contentSourceID']
            ssai_video_id = api['ssai']['videoID']

            dai = self._download_json(
                f'https://dai.google.com/ondemand/dash/content/{ssai_content_source_id}/vid/{ssai_video_id}/streams',
                video_id, data=b'{"api-key":"null"}',

Review comment (suggestion):
```suggestion
            'title': traverse_obj(video_data, ('meta', 'title')),
```

Code after:
        'params': {'skip_download': True},
        'skip': 'This video is only available for registered users',
    }, {
        'url': 'https://www.goplay.be/video/de-mol/de-mol-s11/de-mol-s11-aflevering-1#autoplay',
        'info_dict': {
            'id': 'ecb79672-92b9-4cd9-a0d7-e2f0250681ee',
            'ext': 'mp4',
            'title': 'S11 - Aflevering 1',
            'description': r're:Tien kandidaten beginnen aan hun verovering van Amerika en ontmoeten .{102}',
            'episode': 'Episode 1',
            'series': 'De Mol',
            'season_number': 11,
            'episode_number': 1,
            'season': 'Season 11',
        },
        'params': {'skip_download': True},
        'skip': 'This video is only available for registered users',
    }]

    _id_token = None

    def _perform_login(self, username, password):
        self.report_login()
        aws = AwsIdp(ie=self, pool_id='eu-west-1_dViSsKM5Y', client_id='6s1h851s8uplco5h6mqh1jac8m')
        self._id_token, _ = aws.authenticate(username=username, password=password)

    def _real_initialize(self):
        if not self._id_token:
            raise self.raise_login_required(method='password')

    def _find_json(self, s):
        return self._search_json(
            r'\w+\s*:\s*', s, 'next js data', None, contains_pattern=r'\[(?s:.+)\]', default=None)

    def _real_extract(self, url):
        display_id = self._match_id(url)
        webpage = self._download_webpage(url, display_id)

        nextjs_data = traverse_obj(
            re.findall(r'<script[^>]*>\s*self\.__next_f\.push\(\s*(\[.+?\])\s*\);?\s*</script>', webpage),
            (..., {js_to_json}, {json.loads}, ..., {self._find_json}, ...))
        meta = traverse_obj(nextjs_data, (
            ..., lambda _, v: v['meta']['path'] == urllib.parse.urlparse(url).path, 'meta', any))

        video_id = meta['uuid']
        info_dict = traverse_obj(meta, {
            'title': ('title', {str}),
            'description': ('description', {str.strip}),
        })

        if traverse_obj(meta, ('program', 'subtype')) != 'movie':