]> jfr.im git - yt-dlp.git/commitdiff
[extractor/tnaflix] Fix extractor (#6086)
authoroxamun <redacted>
Sun, 12 Feb 2023 04:21:29 +0000 (23:21 -0500)
committerGitHub <redacted>
Sun, 12 Feb 2023 04:21:29 +0000 (09:51 +0530)
Closes #6085
Authored by: oxamun, bashonly

yt_dlp/extractor/tnaflix.py

index 4482c84746ae350124dbd2a23e62b4b24a0eaab5..b2baf2e871190c52a339f904892221b7b9f8ad5f 100644 (file)
@@ -81,26 +81,27 @@ def _real_extract(self, url):
             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:')
-        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://www.{host}.com/cdn/cdn.php'
-                query.update({
-                    'file': inputs['vkey'],
-                    'key': inputs['nkey'],
-                    'VID': video_id,
-                    'premium': '1',
-                    'vip': '1',
-                    'alpha': '',
-                })
+            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 = [], {}