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

Code before:
            'skip_download': 'm3u8',
        },
    }]

    def _real_extract(self, url):
        channel_id = self._match_id(url)

        gg = self._download_json(f'https://api2.goodgame.ru/v2/streams/{channel_id}', channel_id)

        title = traverse_obj(gg, ('channel', 'title'))
        description = clean_html(traverse_obj(gg, ('channel', 'description')))
        thumb = traverse_obj(gg, ('channel', 'thumb'))

        gg_id = gg.get('id')
        stream_url = f'https://hls.goodgame.ru/manifest/{gg_id}_master.m3u8'
        formats = self._extract_m3u8_formats(
            stream_url, channel_id, 'mp4', m3u8_id='hls', live=True)
        self._sort_formats(formats)

        return {
            'id': channel_id,
            'formats': formats,
            'title': title,
            'description': description,
            'thumbnail': thumb,
        }


Review comment (refactor):
```suggestion
        formats, subtitles = self._extract_m3u8_formats_and_subtitles(
            f'https://hls.goodgame.ru/manifest/{gg["id"]}_master.m3u8',
            channel_id, 'mp4', m3u8_id='hls', live=True)
        self._sort_formats(formats)

        return {
            'id': channel_id,
            'formats': formats,
            'subtitles': subtitles,
            'title': traverse_obj(gg, ('channel', 'title')),
            'description': clean_html(traverse_obj(gg, ('channel', 'description'))),
            'thumbnail': traverse_obj(gg, ('channel', 'thumb')),
            'is_live': True,
        }
```

Code after:
            'channel_url': 'https://goodgame.ru/channel/Pomi/',
            'description': 'md5:4a87b775ee7b2b57bdccebe285bbe171',
            'thumbnail': r're:^https?://.*\.jpg$',
            'live_status': 'is_live',
            'view_count': int,
        },
        'params': {'skip_download': 'm3u8'},
        'skip': 'May not be online',
    }]

    def _real_extract(self, url):
        channel_name = self._match_id(url)
        response = self._download_json(f'https://api2.goodgame.ru/v2/streams/{channel_name}', channel_name)
        player_id = response['channel']['gg_player_src']

        formats, subtitles = [], {}
        if response.get('status') == 'Live':
            formats, subtitles = self._extract_m3u8_formats_and_subtitles(
                f'https://hls.goodgame.ru/manifest/{player_id}_master.m3u8',
                channel_name, 'mp4', live=True)
        else:
            self.raise_no_formats('User is offline', expected=True, video_id=channel_name)

        self._sort_formats(formats)
        return {
            'id': player_id,
            'formats': formats,
            'subtitles': subtitles,
            'title': traverse_obj(response, ('channel', 'title')),
            'channel': channel_name,
            'channel_id': str_or_none(traverse_obj(response, ('channel', 'id'))),
            'channel_url': response.get('url'),
            'description': clean_html(traverse_obj(response, ('channel', 'description'))),
            'thumbnail': traverse_obj(response, ('channel', 'thumb')),
            'is_live': bool(formats),
            'view_count': int_or_none(response.get('viewers')),
            'age_limit': 18 if traverse_obj(response, ('channel', 'adult')) else None,
        }