]> Raphaƫl G. Git Repositories - youtubedl/blobdiff - youtube_dl/extractor/youporn.py
debian/copyright: Fix lintian's dep5-copyright-license-name-not-unique.
[youtubedl] / youtube_dl / extractor / youporn.py
index 107c9ac36e4f4f48bd768567e4399af15fd07743..4ba7c36db78fb457b63e05fe161a75b00383c78c 100644 (file)
@@ -47,11 +47,12 @@ class YouPornIE(InfoExtractor):
 
         # Get JSON parameters
         json_params = self._search_regex(
-            r'var currentVideo = new Video\((.*)\)[,;]',
+            [r'videoJa?son\s*=\s*({.+})',
+             r'var\s+currentVideo\s*=\s*new\s+Video\((.+?)\)[,;]'],
             webpage, 'JSON parameters')
         try:
             params = json.loads(json_params)
-        except:
+        except ValueError:
             raise ExtractorError('Invalid JSON')
 
         self.report_extraction(video_id)