Browse Source

[brightcove] Improve the 'experienceJSON' regex (#3081)

One of the strings may contain ';', we would get an invalid json string.
totalwebcasting
Jaime Marquínez Ferrándiz 11 years ago
parent
commit
a013eba65f
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      youtube_dl/extractor/brightcove.py

+ 1
- 1
youtube_dl/extractor/brightcove.py View File

@ -187,7 +187,7 @@ class BrightcoveIE(InfoExtractor):
webpage = self._download_webpage(req, video_id) webpage = self._download_webpage(req, video_id)
self.report_extraction(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'] info = json.loads(info)['data']
video_info = info['programmedContent']['videoPlayer']['mediaDTO'] video_info = info['programmedContent']['videoPlayer']['mediaDTO']
video_info['_youtubedl_adServerURL'] = info.get('adServerURL') video_info['_youtubedl_adServerURL'] = info.get('adServerURL')


Loading…
Cancel
Save