mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-22 14:24:03 -07:00
Merge 09729eb337
into 551fa9dfbf
This commit is contained in:
commit
bdcfc91b1f
1 changed files with 11 additions and 5 deletions
|
@ -629,18 +629,24 @@ class DailymotionIE(InfoExtractor):
|
||||||
self._downloader.trouble(u'ERROR: unable retrieve video webpage: %s' % str(err))
|
self._downloader.trouble(u'ERROR: unable retrieve video webpage: %s' % str(err))
|
||||||
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:
|
||||||
self._downloader.trouble(u'ERROR: unable to extract media URL')
|
mobj = re.search(r'"video_url":"(.*?)",', urllib.unquote(webpage))
|
||||||
return
|
if mobj:
|
||||||
|
mediaURL = urllib.unquote(mobj.group(1))
|
||||||
|
else:
|
||||||
|
self._downloader.trouble(u'ERROR: unable to extract media URL')
|
||||||
|
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
|
||||||
mediaURL = urllib.unquote(mobj.group(1)).replace('\\', '')
|
if not mediaURL:
|
||||||
|
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…
Add table
Add a link
Reference in a new issue