mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-03-16 04:52:22 +09:00
works correctly with the youtube-dl IE architecture
previous commit returned media URL, but this one retrieves it and uses it to download
This commit is contained in:
parent
eb6cf05f2a
commit
09729eb337
@ -628,19 +628,22 @@ class DailymotionIE(InfoExtractor):
|
|||||||
return
|
return
|
||||||
|
|
||||||
# Extract URL, uploader and title from webpage
|
# Extract URL, uploader and title from webpage
|
||||||
|
mediaURL = None
|
||||||
self.report_extraction(video_id)
|
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:
|
if mobj is None:
|
||||||
mobj = re.search(r'"video_url":"(.*?)",', urllib.unquote(webpage))
|
mobj = re.search(r'"video_url":"(.*?)",', urllib.unquote(webpage))
|
||||||
if mobj:
|
if mobj:
|
||||||
return urllib.unquote(mobj.group(1))
|
mediaURL = urllib.unquote(mobj.group(1))
|
||||||
|
else:
|
||||||
self._downloader.trouble(u'ERROR: unable to extract media URL')
|
self._downloader.trouble(u'ERROR: unable to extract media URL')
|
||||||
return
|
return
|
||||||
sequence = urllib.unquote(mobj.group(1))
|
sequence = urllib.unquote(mobj.group(1))
|
||||||
mobj = re.search(r',\"sdURL\"\:\"([^\"]+?)\",', sequence)
|
mobj = re.search(r',\"sdURL\"\:\"([^\"]+?)\",', sequence)
|
||||||
if mobj is None:
|
if mobj is None and not mediaURL:
|
||||||
self._downloader.trouble(u'ERROR: unable to extract media URL')
|
self._downloader.trouble(u'ERROR: unable to extract media URL')
|
||||||
return
|
return
|
||||||
|
if not mediaURL:
|
||||||
mediaURL = urllib.unquote(mobj.group(1)).replace('\\', '')
|
mediaURL = urllib.unquote(mobj.group(1)).replace('\\', '')
|
||||||
|
|
||||||
# if needed add http://www.dailymotion.com/ if relative URL
|
# if needed add http://www.dailymotion.com/ if relative URL
|
||||||
|
Loading…
Reference in New Issue
Block a user