X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fauengine.py;h=a1b666be0a4ce1610cfad79f5393ec23a9427bc8;hb=6291438073e35adc94f573a43625fb54a64cf733;hp=17c3ad2ef6d62119062a44f8c01c85cb08e33b28;hpb=18c3c15391de27d4dd6e550087ca244d294a9bf2;p=youtube-dl diff --git a/youtube_dl/extractor/auengine.py b/youtube_dl/extractor/auengine.py index 17c3ad2ef..a1b666be0 100644 --- a/youtube_dl/extractor/auengine.py +++ b/youtube_dl/extractor/auengine.py @@ -7,6 +7,7 @@ from ..compat import compat_urllib_parse from ..utils import ( determine_ext, ExtractorError, + remove_end, ) @@ -27,18 +28,18 @@ class AUEngineIE(InfoExtractor): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) - title = self._html_search_regex(r'(?P<title>.+?)', webpage, 'title') - title = title.strip() - video_url = re.findall(r'http://\w+.auengine.com/vod/.*[^\W]', webpage) - video_url = map(compat_urllib_parse.unquote, video_url)[0] - thumbnail = re.findall(r'http://\w+.auengine.com/thumb/.*[^\W]', webpage) - thumbnail = map(compat_urllib_parse.unquote, thumbnail)[0] - - if video_url == "" and thumbnail =="": + title = self._html_search_regex( + r'\s*(?P<title>.+?)\s*', webpage, 'title') + video_urls = re.findall(r'http://\w+.auengine.com/vod/.*[^\W]', webpage) + video_url = compat_urllib_parse.unquote(video_urls[0]) + thumbnails = re.findall(r'http://\w+.auengine.com/thumb/.*[^\W]', webpage) + thumbnail = compat_urllib_parse.unquote(thumbnails[0]) + + if not video_url: raise ExtractorError('Could not find video URL') + ext = '.' + determine_ext(video_url) - if ext == title[-len(ext):]: - title = title[:-len(ext)] + title = remove_end(title, ext) return { 'id': video_id, @@ -47,4 +48,3 @@ class AUEngineIE(InfoExtractor): 'thumbnail': thumbnail, 'http_referer': 'http://www.auengine.com/flowplayer/flowplayer.commercial-3.2.14.swf', } -