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

Code before:
        app_version = '3.5.57'
        platform = '4830201'

        ckey = self._get_ckey(video_id, video_url, app_version, platform)
        query = {
            'vid': video_id,
            'cid': series_id,
            'cKey': ckey,
            'encryptVer': '8.1',
            'spcaptiontype': '1' if subtitle_format == 'vtt' else '0',  # 0 - SRT, 1 - VTT
            'sphls': '1' if video_format == 'hls' else '0',  # 0 - MP4, 1 - HLS
            'defn': video_quality,  # '': 480p, 'shd': 720p, 'fhd': 1080p
            'spsrt': '1',  # Enable subtitles
            'sphttps': '1',  # Enable HTTPS
            'otype': 'json',  # Response format: xml, json,
            'dtype': '1',
            'spwm': '1',
            'host': 'wetv.vip',  # These three values are needed for SHD
            'referer': 'wetv.vip',
            'ehost': video_url,
            'appVer': app_version,
            'platform': platform,
        }

        return self._search_json(r'QZOutputJson=', self._download_webpage('https://play.wetv.vip/getvinfo', video_id,
                                 query=query), 'api_response', video_id)

    def _get_webpage_metadata(self, webpage, video_id):
        return self._parse_json(
            traverse_obj(self._search_nextjs_data(webpage, video_id), ('props', 'pageProps', 'data')),
            video_id, fatal=False)


class WeTvEpisodeIE(WeTvBaseIE):
    IE_NAME = 'wetv:episode'
    _VALID_URL = WeTvBaseIE._VALID_URL_BASE + r'/(?P<series_id>\w+)(?:-[^?#]+)?/(?P<id>\w+)(?:-[^?#]+)?'

    _TESTS = [{
        'url': 'https://wetv.vip/en/play/air11ooo2rdsdi3-Cute-Programmer/v0040pr89t9-EP1-Cute-Programmer',
        'md5': 'a046f565c9dce9b263a0465a422cd7bf',
        'info_dict': {
            'id': 'v0040pr89t9',
            'ext': 'mp4',
            'title': 'EP1: Cute Programmer',
            'description': 'md5:e87beab3bf9f392d6b9e541a63286343',
            'thumbnail': r're:^https?://[^?#]+air11ooo2rdsdi3',
            'series': 'Cute Programmer',
            'episode': 'Episode 1',
            'episode_number': 1,
            'duration': 2835,
        },

Review comment (suggestion):
```suggestion
        return self._search_json(r'QZOutputJson=', self._download_webpage(
            'https://play.wetv.vip/getvinfo', video_id, query=query), 'api_response', video_id)
```

Code after:
        app_version = '3.5.57'
        platform = '4830201'

        ckey = self._get_ckey(video_id, video_url, app_version, platform)
        query = {
            'vid': video_id,
            'cid': series_id,
            'cKey': ckey,
            'encryptVer': '8.1',
            'spcaptiontype': '1' if subtitle_format == 'vtt' else '0',  # 0 - SRT, 1 - VTT
            'sphls': '1' if video_format == 'hls' else '0',  # 0 - MP4, 1 - HLS
            'defn': video_quality,  # '': 480p, 'shd': 720p, 'fhd': 1080p
            'spsrt': '1',  # Enable subtitles
            'sphttps': '1',  # Enable HTTPS
            'otype': 'json',  # Response format: xml, json,
            'dtype': '1',
            'spwm': '1',
            'host': 'wetv.vip',  # These three values are needed for SHD
            'referer': 'wetv.vip',
            'ehost': video_url,
            'appVer': app_version,
            'platform': platform,
        }

        return self._search_json(r'QZOutputJson=', self._download_webpage(
            'https://play.wetv.vip/getvinfo', video_id, query=query), 'api_response', video_id)

    def _get_webpage_metadata(self, webpage, video_id):
        return self._parse_json(
            traverse_obj(self._search_nextjs_data(webpage, video_id), ('props', 'pageProps', 'data')),
            video_id, fatal=False)


class WeTvEpisodeIE(WeTvBaseIE):
    IE_NAME = 'wetv:episode'
    _VALID_URL = WeTvBaseIE._VALID_URL_BASE + r'/(?P<series_id>\w+)(?:-[^?#]+)?/(?P<id>\w+)(?:-[^?#]+)?'

    _TESTS = [{
        'url': 'https://wetv.vip/en/play/air11ooo2rdsdi3-Cute-Programmer/v0040pr89t9-EP1-Cute-Programmer',
        'md5': 'a046f565c9dce9b263a0465a422cd7bf',
        'info_dict': {
            'id': 'v0040pr89t9',
            'ext': 'mp4',
            'title': 'EP1: Cute Programmer',
            'description': 'md5:e87beab3bf9f392d6b9e541a63286343',
            'thumbnail': r're:^https?://[^?#]+air11ooo2rdsdi3',
            'series': 'Cute Programmer',
            'episode': 'Episode 1',
            'episode_number': 1,
            'duration': 2835,
        },