[extractor/common] Improve jwplayer regex
authorSergey M․ <dstftw@gmail.com>
Tue, 25 Apr 2017 16:46:05 +0000 (23:46 +0700)
committerSergey M․ <dstftw@gmail.com>
Tue, 25 Apr 2017 16:46:05 +0000 (23:46 +0700)
youtube_dl/extractor/common.py

index 9184e53e94c3b18c75ccde07b058c01ab65867bd..8b3f04c61a6ca859eaa334b32e0450f89c71a868 100644 (file)
@@ -2233,7 +2233,7 @@ class InfoExtractor(object):
 
     def _find_jwplayer_data(self, webpage, video_id=None, transform_source=js_to_json):
         mobj = re.search(
-            r'(?s)jwplayer\((?P<quote>[\'"])[^\'" ]+(?P=quote)\).*?\.setup\s*\((?P<options>[^)]+)\)',
+            r'(?s)jwplayer\((?P<quote>[\'"])[^\'" ]+(?P=quote)\)(?!</script>).*?\.setup\s*\((?P<options>[^)]+)\)',
             webpage)
         if mobj:
             try: