X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fbrightcove.py;h=294670386256dc45a071544345e259cbf545e7c7;hb=cc7fec5818254f4679896823c7de9d17f50201ca;hp=acf8b2dc2ee13b0b3487a807f62e236fcde8e867;hpb=96bef88f5f0eea0b2c5410a6cbb65cc820d72b30;p=youtube-dl diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dl/extractor/brightcove.py index acf8b2dc2..294670386 100644 --- a/youtube_dl/extractor/brightcove.py +++ b/youtube_dl/extractor/brightcove.py @@ -154,12 +154,14 @@ class BrightcoveIE(InfoExtractor): def _extract_brightcove_urls(cls, webpage): """Return a list of all Brightcove URLs from the webpage """ - url_m = re.search(r'We're sorry.\s*

(.*?)

", webpage, + 'error message', default=None) + if error_msg is not None: + raise ExtractorError( + 'brightcove said: %s' % error_msg, expected=True) + self.report_extraction(video_id) info = self._search_regex(r'var experienceJSON = ({.*});', webpage, 'json') info = json.loads(info)['data'] @@ -235,7 +248,6 @@ class BrightcoveIE(InfoExtractor): renditions = video_info.get('renditions') if renditions: - renditions = sorted(renditions, key=lambda r: r['size']) formats = [] for rend in renditions: url = rend['defaultURL'] @@ -246,12 +258,15 @@ class BrightcoveIE(InfoExtractor): ext = 'flv' else: ext = determine_ext(url) + size = rend.get('size') formats.append({ 'url': url, 'ext': ext, 'height': rend.get('frameHeight'), 'width': rend.get('frameWidth'), + 'filesize': size if size != 0 else None, }) + self._sort_formats(formats) info['formats'] = formats elif video_info.get('FLVFullLengthURL') is not None: info.update({