Browse Source

[youporn] Imrove JSON regex and preserve the old one

Sergey M․ 10 years ago
parent
commit
50c9949d7a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      youtube_dl/extractor/youporn.py

+ 2 - 1
youtube_dl/extractor/youporn.py

@@ -47,7 +47,8 @@ class YouPornIE(InfoExtractor):
 
 
         # Get JSON parameters
         # Get JSON parameters
         json_params = self._search_regex(
         json_params = self._search_regex(
-            r'var videoJason = (.*)[,;]',
+            [r'var\s+videoJa?son\s*=\s*({.+?});',
+             r'var\s+currentVideo\s*=\s*new\s+Video\((.+?)\)[,;]'],
             webpage, 'JSON parameters')
             webpage, 'JSON parameters')
         try:
         try:
             params = json.loads(json_params)
             params = json.loads(json_params)