[brightcove] Improve the 'experienceJSON' regex (#3081)
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sun, 15 Jun 2014 09:08:24 +0000 (11:08 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sun, 15 Jun 2014 09:08:24 +0000 (11:08 +0200)
One of the strings may contain ';', we would get an invalid json string.

youtube_dl/extractor/brightcove.py

index 3c02c297a58a32cf536e8ccc972dea68021f650b..6b98bd2784069a54bd7f136814d2efab3faf2be4 100644 (file)
@@ -187,7 +187,7 @@ class BrightcoveIE(InfoExtractor):
         webpage = self._download_webpage(req, video_id)
 
         self.report_extraction(video_id)
-        info = self._search_regex(r'var experienceJSON = ({.*?});', webpage, 'json')
+        info = self._search_regex(r'var experienceJSON = ({.*});', webpage, 'json')
         info = json.loads(info)['data']
         video_info = info['programmedContent']['videoPlayer']['mediaDTO']
         video_info['_youtubedl_adServerURL'] = info.get('adServerURL')