Merge branch 'master' of github.com:rg3/youtube-dl
authorPhilipp Hagemeister <phihag@phihag.de>
Mon, 1 Oct 2012 16:38:19 +0000 (18:38 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Mon, 1 Oct 2012 16:38:19 +0000 (18:38 +0200)
youtube-dl
youtube-dl.exe
youtube_dl/InfoExtractors.py

index fd5e09c3b710e6b833f7fc4a67fa14b4141d3eb2..1055d246d3a9230e3d51f37bef20d0dbc2112716 100755 (executable)
Binary files a/youtube-dl and b/youtube-dl differ
index bf7ba04d0360c41e5f92fe16347acf6f6a29e0b7..2b82e43f2f88da48a77dd549d997c8f372b1da2f 100755 (executable)
Binary files a/youtube-dl.exe and b/youtube-dl.exe differ
index bdb2ec3110321c2628b281d36062ffa1bdb0905f..8d428b25dcd1ff828044881b1ff7dd89705fd12d 100644 (file)
@@ -616,7 +616,7 @@ class MetacafeIE(InfoExtractor):
 class DailymotionIE(InfoExtractor):
        """Information Extractor for Dailymotion"""
 
-       _VALID_URL = r'(?i)(?:https?://)?(?:www\.)?dailymotion\.[a-z]{2,3}/video/([^_/]+)_([^/]+)'
+       _VALID_URL = r'(?i)(?:https?://)?(?:www\.)?dailymotion\.[a-z]{2,3}/video/([^/]+)'
        IE_NAME = u'dailymotion'
 
        def __init__(self, downloader=None):
@@ -637,7 +637,7 @@ class DailymotionIE(InfoExtractor):
                        self._downloader.trouble(u'ERROR: invalid URL: %s' % url)
                        return
 
-               video_id = mobj.group(1)
+               video_id = mobj.group(1).split('_')[0].split('?')[0]
 
                video_extension = 'mp4'
 
@@ -662,10 +662,12 @@ class DailymotionIE(InfoExtractor):
                elif 'sdURL' in flashvars: max_quality = 'sdURL'
                else: max_quality = 'ldURL'
                mobj = re.search(r'"' + max_quality + r'":"(.+?)"', flashvars)
+               if mobj is None:
+                       mobj = re.search(r'"video_url":"(.*?)",', flashvars)
                if mobj is None:
                        self._downloader.trouble(u'ERROR: unable to extract media URL')
                        return
-               video_url = mobj.group(1).replace('\\/', '/')
+               video_url = urllib.unquote(mobj.group(1)).replace('\\/', '/')
 
                # TODO: support choosing qualities