diff --git a/youtube-dl b/youtube-dl index 8c4c320df..39a196636 100755 --- a/youtube-dl +++ b/youtube-dl @@ -1603,12 +1603,19 @@ class DailymotionIE(InfoExtractor): # Extract URL, uploader and title from webpage self.report_extraction(video_id) - mobj = re.search(r'(?i)addVariable\(\"sequence\"\s*,\s*\"([^\"]+?)\"\)', webpage) + mobj = re.search(r'(?i)addVariable\(\"sequence\"\s*,\s*\"([^\"]+)\"\)', webpage) if mobj is None: self._downloader.trouble(u'ERROR: unable to extract media URL') return sequence = urllib.unquote(mobj.group(1)) - mobj = re.search(r',\"sdURL\"\:\"([^\"]+?)\",', sequence) + + mobj = None + for key in ['hd1080URL', 'hd720URL', 'hqURL', 'sdURL']: + pattern = re.compile(r',\"%s\"\:\"([^\"]+)\",' % key) + mobj = re.search(pattern, sequence) + if mobj is not None: + self._downloader.to_screen(u'[dailymotion] Using %s' % key) + break if mobj is None: self._downloader.trouble(u'ERROR: unable to extract media URL') return @@ -1618,18 +1625,19 @@ class DailymotionIE(InfoExtractor): video_url = mediaURL - mobj = re.search(r'(?im)