mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-05-07 14:17:32 +00:00
Merge 7401ca7c5f5fe84f4d2e638adc4cd50e2a9b6285 into c95da745bc30db1df511012ff8abbf29fb27413e
This commit is contained in:
commit
8ead1ce9ce
22
youtube-dl
22
youtube-dl
@ -1603,12 +1603,19 @@ class DailymotionIE(InfoExtractor):
|
|||||||
|
|
||||||
# Extract URL, uploader and title from webpage
|
# Extract URL, uploader and title from webpage
|
||||||
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')
|
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 = 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:
|
if mobj is None:
|
||||||
self._downloader.trouble(u'ERROR: unable to extract media URL')
|
self._downloader.trouble(u'ERROR: unable to extract media URL')
|
||||||
return
|
return
|
||||||
@ -1618,18 +1625,19 @@ class DailymotionIE(InfoExtractor):
|
|||||||
|
|
||||||
video_url = mediaURL
|
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:
|
if mobj is None:
|
||||||
self._downloader.trouble(u'ERROR: unable to extract title')
|
self._downloader.trouble(u'ERROR: unable to extract title')
|
||||||
return
|
return
|
||||||
video_title = mobj.group(1).decode('utf-8')
|
video_title = mobj.group(1).decode('utf-8')
|
||||||
video_title = sanitize_title(video_title)
|
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:
|
if mobj is None:
|
||||||
self._downloader.trouble(u'ERROR: unable to extract uploader nickname')
|
self._downloader.to_screen(u'WARNING: unable to extract uploader nickname')
|
||||||
return
|
else:
|
||||||
video_uploader = mobj.group(1)
|
video_uploader = mobj.group(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Process video information
|
# Process video information
|
||||||
|
Loading…
x
Reference in New Issue
Block a user