X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fauengine.py;h=17c3ad2ef6d62119062a44f8c01c85cb08e33b28;hb=03ff2cc1c49c82daf2218b76e169c2d679447f03;hp=20bf12550d4b4493982ca3ea6f31578368e31aba;hpb=e55213ce3583aa348b288d51f99f1f46510c3fd4;p=youtube-dl diff --git a/youtube_dl/extractor/auengine.py b/youtube_dl/extractor/auengine.py index 20bf12550..17c3ad2ef 100644 --- a/youtube_dl/extractor/auengine.py +++ b/youtube_dl/extractor/auengine.py @@ -3,8 +3,8 @@ from __future__ import unicode_literals import re from .common import InfoExtractor +from ..compat import compat_urllib_parse from ..utils import ( - compat_urllib_parse, determine_ext, ExtractorError, ) @@ -24,23 +24,17 @@ class AUEngineIE(InfoExtractor): } def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - video_id = mobj.group('id') + 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() - links = re.findall(r'\s(?:file|url):\s*["\']([^\'"]+)["\']', webpage) - links = map(compat_urllib_parse.unquote, links) - - thumbnail = None - video_url = None - for link in links: - if link.endswith('.png'): - thumbnail = link - elif '/videos/' in link: - video_url = link - if not video_url: + 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 =="": raise ExtractorError('Could not find video URL') ext = '.' + determine_ext(video_url) if ext == title[-len(ext):]: @@ -53,3 +47,4 @@ class AUEngineIE(InfoExtractor): 'thumbnail': thumbnail, 'http_referer': 'http://www.auengine.com/flowplayer/flowplayer.commercial-3.2.14.swf', } +