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

Code before:
            'episode': 'Episode 0',
            'episode_number': 0,
            'duration': 442,
        },
    }]

    def _extract_video_formats_and_subtitles(self, api_response, video_id, video_quality):
        video_response = api_response['vl']['vi'][0]
        video_width = video_response.get('vw')
        video_height = video_response.get('vh')

        formats, subtitles = [], {}
        for video_format in video_response['ul']['ui']:
            if video_format.get('hls'):
                fmts, subs = self._extract_m3u8_formats_and_subtitles(
                    video_format.get('url') + traverse_obj(video_format, ('hls', 'pname')), video_id, 'mp4', fatal=False)

                for f in fmts:
                    f['width'] = video_width
                    f['height'] = video_height

                formats.extend(fmts)
                self._merge_subtitles(subs, target=subtitles)
            else:
                formats.append({
                    'url': f"{video_format['url']}{video_response['fn']}?vkey={video_response['fvkey']}",
                    'width': video_width,
                    'height': video_height,
                    'ext': 'mp4',
                })

        return formats, subtitles

    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)

Review comment (suggestion):
```suggestion
                    'url': f'{video_format["url"]}{video_response["fn"]}?vkey={video_response["fvkey"]}',
```

Code after:
            'episode': 'Episode 0',
            'episode_number': 0,
            'duration': 442,
        },
    }]

    def _extract_video_formats_and_subtitles(self, api_response, video_id, video_quality):
        video_response = api_response['vl']['vi'][0]
        video_width = video_response.get('vw')
        video_height = video_response.get('vh')

        formats, subtitles = [], {}
        for video_format in video_response['ul']['ui']:
            if video_format.get('hls'):
                fmts, subs = self._extract_m3u8_formats_and_subtitles(
                    video_format['url'] + video_format['hls']['pname'], video_id, 'mp4', fatal=False)
                for f in fmts:
                    f['width'] = video_width
                    f['height'] = video_height

                formats.extend(fmts)
                self._merge_subtitles(subs, target=subtitles)
            else:
                formats.append({
                    'url': f'{video_format["url"]}{video_response["fn"]}?vkey={video_response["fvkey"]}',
                    'width': video_width,
                    'height': video_height,
                    'ext': 'mp4',
                })

        return formats, subtitles

    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)