mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-03-16 04:52:22 +09:00
Using class="name" when class="owner" does not exists to obtain the uploader name
This commit is contained in:
parent
2b8ee7c239
commit
eda204a2dc
@ -1750,10 +1750,12 @@ class DailymotionIE(InfoExtractor):
|
|||||||
video_title = sanitize_title(video_title)
|
video_title = sanitize_title(video_title)
|
||||||
simple_title = _simplify_title(video_title)
|
simple_title = _simplify_title(video_title)
|
||||||
|
|
||||||
mobj = re.search(r'(?im)<span class="owner[^\"]+?">[^<]+?<a [^>]+?>([^<]+?)</a></span>', webpage)
|
spanowner = re.search(r'(?im)<span class="owner[^\"]+?">[^<]+?<a [^>]+?>([^<]+?)</a></span>', webpage)
|
||||||
|
spanname = re.search(r'(?im)<span class="name[^\"]+?"[^\>]+?>([^\>]+?)</span>', webpage)
|
||||||
|
mobj = spanowner if spanowner else spanname
|
||||||
if mobj is None:
|
if mobj is None:
|
||||||
video_uploader = "Unknown"
|
video_uploader = "Unknown"
|
||||||
#you need to use -i option to discard this error
|
#you need to use -i option to discard this error and continue with the download
|
||||||
self._downloader.trouble(u'WARNING: unable to extract uploader nickname')
|
self._downloader.trouble(u'WARNING: unable to extract uploader nickname')
|
||||||
else:
|
else:
|
||||||
video_uploader = mobj.group(1)
|
video_uploader = mobj.group(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user