mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-22 06:14:05 -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))
|
||||
return
|
||||
|
||||
# Extract URL, uploader and title from webpage
|
||||
# Extract URL, uploader and title from webpage
|
||||
mediaURL = None
|
||||
self.report_extraction(video_id)
|
||||
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
|
||||
mobj = re.search(r'"video_url":"(.*?)",', urllib.unquote(webpage))
|
||||
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))
|
||||
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')
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue