[Auengine] corrected extractions logic
authoroteng <otengkwaku@gmail.com>
Mon, 5 Jan 2015 16:28:24 +0000 (16:28 +0000)
committeroteng <otengkwaku@gmail.com>
Mon, 5 Jan 2015 16:28:24 +0000 (16:28 +0000)
The way the video download url was been extracted was
not working well so i change it for it to extract the
correct url

.gitignore
youtube_dl/extractor/auengine.py

index 86312d4e4185cd6dbd56627a3f2ce9f8ef5e9a43..0422adf4456ec35166f5d2bce6b832c67601c2dc 100644 (file)
@@ -31,3 +31,5 @@ updates_key.pem
 test/testdata
 .tox
 youtube-dl.zsh
+.idea
+.idea/*
\ No newline at end of file
index 014a219522d5de5ab85415cb8aeca0a93561a409..17c3ad2ef6d62119062a44f8c01c85cb08e33b28 100644 (file)
@@ -29,17 +29,12 @@ class AUEngineIE(InfoExtractor):
         webpage = self._download_webpage(url, video_id)
         title = self._html_search_regex(r'<title>(?P<title>.+?)</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):]:
@@ -52,3 +47,4 @@ class AUEngineIE(InfoExtractor):
             'thumbnail': thumbnail,
             'http_referer': 'http://www.auengine.com/flowplayer/flowplayer.commercial-3.2.14.swf',
         }
+