Skip to content

Loading…

Fixed download from Dailymotion to support HD movies #176

Closed
wants to merge 1 commit into from

4 participants

@knagano

DailymotionIE: Added hd1080URL, hd720URL, hqURL support. Now video_uploader is optional.

@phihag
Collaborator

Looks great. I'll test and merge it soon. Thanks!

@phihag phihag was assigned
@baryluk

Any progress on this? knagano does patched version still works? Dailymotion from time to time changes their layout, and it sometimes breaks youtube-dl.

@FiloSottile
Collaborator

Uh, this looks similar to to my patch of today to get Dailymotion back at work... Might pull some changes.

@FiloSottile FiloSottile was assigned
@FiloSottile FiloSottile closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 26, 2011
  1. @knagano
Showing with 15 additions and 7 deletions.
  1. +15 −7 youtube-dl
View
22 youtube-dl
@@ -1563,12 +1563,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
@@ -1578,18 +1585,19 @@ class DailymotionIE(InfoExtractor):
video_url = mediaURL
- mobj = re.search(r'(?im)<title>Dailymotion\s*-\s*(.+)\s*-\s*[^<]+?</title>', webpage)
+ mobj = re.search(r'(?im)<title>Dailymotion\s*-\s*(.+)\s*-\s*[^<]+</title>', webpage)
if mobj is None:
self._downloader.trouble(u'ERROR: unable to extract title')
return
video_title = mobj.group(1).decode('utf-8')
video_title = sanitize_title(video_title)
- mobj = re.search(r'(?im)<span class="owner[^\"]+?">[^<]+?<a [^>]+?>([^<]+?)</a></span>', webpage)
+ video_uploader = ''
+ mobj = re.search(r'(?im)<span class="owner[^\"]+">[^<]+<a [^>]+>([^<]+)</a></span>', webpage)
if mobj is None:
- self._downloader.trouble(u'ERROR: unable to extract uploader nickname')
- return
- video_uploader = mobj.group(1)
+ self._downloader.to_screen(u'WARNING: unable to extract uploader nickname')
+ else:
+ video_uploader = mobj.group(1)
try:
# Process video information
Something went wrong with that request. Please try again.