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

Code before:

    def _extract_video_subtitles(self, api_response, subtitles_format):
        subtitles = {}
        for subtitle in traverse_obj(api_response, ('sfl', 'fi')):
            subtitles[subtitle['lang'].lower()] = [{
                'url': subtitle['url'],
                'ext': subtitles_format,
                'protocol': 'm3u8_native' if subtitles_format == 'vtt' else 'http'
            }]

        return subtitles

    def _real_extract(self, url):
        video_id, series_id = self._match_valid_url(url).group('id', 'series_id')
        webpage = self._download_webpage(url, video_id)

        formats, subtitles = [], {}
        for video_format, subtitle_format, video_quality in (('mp4', 'srt', ''), ('hls', 'vtt', 'shd'), ('hls', 'vtt', 'fhd')):
            api_response = self._get_video_api_response(url, video_id, series_id, subtitle_format, video_format, video_quality)

            fmts, subs = self._extract_video_formats_and_subtitles(api_response, video_id, video_quality)
            native_subtitles = self._extract_video_subtitles(api_response, subtitle_format)

            formats.extend(fmts)
            self._merge_subtitles(subs, target=subtitles)
            self._merge_subtitles(native_subtitles, target=subtitles)

        self._sort_formats(formats)
        webpage_metadata = self._get_webpage_metadata(webpage, video_id)

        return {
            'id': video_id,
            'title': (self._og_search_title(webpage)
                      or traverse_obj(webpage_metadata, ('coverInfo', 'description'))),
            'description': (self._og_search_description(webpage)
                            or traverse_obj(webpage_metadata, ('coverInfo', 'description'))),
            'formats': formats,
            'subtitles': subtitles,
            'thumbnail': self._og_search_thumbnail(webpage),
            'duration': int_or_none(traverse_obj(webpage_metadata, ('videoInfo', 'duration'))),
            'series': traverse_obj(webpage_metadata, ('coverInfo', 'title')),
            'episode_number': int_or_none(traverse_obj(webpage_metadata, ('videoInfo', 'episode'))),
        }


class WeTvSeriesIE(WeTvBaseIE):
    _VALID_URL = WeTvBaseIE._VALID_URL_BASE + r'/(?P<id>\w+)(?:-[^/?#]+)?/?(?:[?#]|$)'

    _TESTS = [{
        'url': 'https://wetv.vip/play/air11ooo2rdsdi3-Cute-Programmer',
        'info_dict': {

Review comment (suggestion):
```suggestion
            self._merge_subtitles(subs, native_subtitles, target=subtitles)
```

Code after:
    def _extract_video_subtitles(self, api_response, subtitles_format):
        subtitles = {}
        for subtitle in traverse_obj(api_response, ('sfl', 'fi')):
            subtitles.setdefault(subtitle['lang'].lower(), []).append({
                'url': subtitle['url'],
                'ext': subtitles_format,
                'protocol': 'm3u8_native' if determine_ext(subtitle['url']) == 'm3u8' else 'http',
            })

        return subtitles

    def _real_extract(self, url):
        video_id, series_id = self._match_valid_url(url).group('id', 'series_id')
        webpage = self._download_webpage(url, video_id)

        formats, subtitles = [], {}
        for video_format, subtitle_format, video_quality in (('mp4', 'srt', ''), ('hls', 'vtt', 'shd'), ('hls', 'vtt', 'fhd')):
            api_response = self._get_video_api_response(url, video_id, series_id, subtitle_format, video_format, video_quality)

            fmts, subs = self._extract_video_formats_and_subtitles(api_response, video_id, video_quality)
            native_subtitles = self._extract_video_subtitles(api_response, subtitle_format)

            formats.extend(fmts)
            self._merge_subtitles(subs, native_subtitles, target=subtitles)

        self._sort_formats(formats)
        webpage_metadata = self._get_webpage_metadata(webpage, video_id)

        return {
            'id': video_id,
            'title': (self._og_search_title(webpage)
                      or traverse_obj(webpage_metadata, ('coverInfo', 'description'))),
            'description': (self._og_search_description(webpage)
                            or traverse_obj(webpage_metadata, ('coverInfo', 'description'))),
            'formats': formats,
            'subtitles': subtitles,
            'thumbnail': self._og_search_thumbnail(webpage),
            'duration': int_or_none(traverse_obj(webpage_metadata, ('videoInfo', 'duration'))),
            'series': traverse_obj(webpage_metadata, ('coverInfo', 'title')),
            'episode_number': int_or_none(traverse_obj(webpage_metadata, ('videoInfo', 'episode'))),
        }


class WeTvSeriesIE(WeTvBaseIE):
    _VALID_URL = WeTvBaseIE._VALID_URL_BASE + r'/(?P<id>\w+)(?:-[^/?#]+)?/?(?:[?#]|$)'

    _TESTS = [{
        'url': 'https://wetv.vip/play/air11ooo2rdsdi3-Cute-Programmer',
        'info_dict': {
            'id': 'air11ooo2rdsdi3',
            'title': 'Cute Programmer',