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

Code before:
        } for i in range(first, last + 1)]

    def _real_extract(self, url):
        mobj = self._match_valid_url(url)
        video_id, host = mobj.group('id', 'host')
        for display_id_key in ('display_id', 'display_id_2'):
            if display_id_key in mobj.groupdict():
                display_id = mobj.group(display_id_key)
                if display_id:
                    break
        else:
            display_id = video_id

        webpage = self._download_webpage(url, display_id)

        # check for MovieFap-style config
        cfg_url = self._proto_relative_url(self._html_search_regex(
            self._CONFIG_REGEX, webpage, 'flashvars.config', default=None,
            group='url'), 'http:')
        query = {}

        # check for TNAFlix-style config
        if not cfg_url:
            inputs = self._hidden_inputs(webpage)
            if inputs.get('vkey') and inputs.get('nkey'):
                cfg_url = f"https://cdn-fck.{host}.com/{host}/{inputs['vkey']}.fid"
                query.update({
                    'key': inputs['nkey'],
                    'VID': video_id,
                    'premium': '1',
                    'vip': '1',
                    'alpha': '',
                })

        formats, json_ld = [], {}

        # TNAFlix and MovieFap extraction
        if cfg_url:
            cfg_xml = self._download_xml(
                cfg_url, display_id, 'Downloading metadata',
                transform_source=fix_xml_ampersands, headers={'Referer': url}, query=query)

            def extract_video_url(vl):
                # Any URL modification now results in HTTP Error 403: Forbidden
                return unescapeHTML(vl.text)

            video_link = cfg_xml.find('./videoLink')
            if video_link is not None:
                formats.append({
                    'url': extract_video_url(video_link),
                    'ext': xpath_text(cfg_xml, './videoConfig/type', 'type', default='flv'),

Review comment (suggestion):
change `cfg_url` to `http` here to avoid cert problems
single-quotes for outer and double-quotes for inner
```suggestion
                cfg_url = f'http://cdn-fck.{host}.com/{host}/{inputs["vkey"]}.fid'
```

Code after:
        } for i in range(first, last + 1)]

    def _real_extract(self, url):
        mobj = self._match_valid_url(url)
        video_id, host = mobj.group('id', 'host')
        for display_id_key in ('display_id', 'display_id_2'):
            if display_id_key in mobj.groupdict():
                display_id = mobj.group(display_id_key)
                if display_id:
                    break
        else:
            display_id = video_id

        webpage = self._download_webpage(url, display_id)
        inputs = self._hidden_inputs(webpage)
        query = {}

        # check for MovieFap-style config
        cfg_url = self._proto_relative_url(self._html_search_regex(
            self._CONFIG_REGEX, webpage, 'flashvars.config', default=None,
            group='url'), 'http:')

        if not cfg_url:
            cfg_url = inputs.get('config')

        # check for TNAFlix-style config
        if not cfg_url and inputs.get('vkey') and inputs.get('nkey'):
            cfg_url = f'http://cdn-fck.{host}.com/{host}/{inputs["vkey"]}.fid'
            query.update({
                'key': inputs['nkey'],
                'VID': video_id,
                'premium': '1',
                'vip': '1',
                'alpha': '',
            })

        formats, json_ld = [], {}

        # TNAFlix and MovieFap extraction
        if cfg_url:
            cfg_xml = self._download_xml(
                cfg_url, display_id, 'Downloading metadata',
                transform_source=fix_xml_ampersands, headers={'Referer': url}, query=query)

            def extract_video_url(vl):
                # Any URL modification now results in HTTP Error 403: Forbidden
                return unescapeHTML(vl.text)

            video_link = cfg_xml.find('./videoLink')
            if video_link is not None:
                formats.append({