mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 02:42:30 +00:00
Fix Dailymotion in Python 3
This commit is contained in:
parent
bec102a843
commit
28ca6b5afa
@ -666,7 +666,8 @@ def _real_extract(self, url):
|
|||||||
request.add_header('Cookie', 'family_filter=off')
|
request.add_header('Cookie', 'family_filter=off')
|
||||||
try:
|
try:
|
||||||
self.report_download_webpage(video_id)
|
self.report_download_webpage(video_id)
|
||||||
webpage = compat_urllib_request.urlopen(request).read()
|
webpage_bytes = compat_urllib_request.urlopen(request).read()
|
||||||
|
webpage = webpage_bytes.decode('utf-8')
|
||||||
except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
|
except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
|
||||||
self._downloader.trouble(u'ERROR: unable retrieve video webpage: %s' % compat_str(err))
|
self._downloader.trouble(u'ERROR: unable retrieve video webpage: %s' % compat_str(err))
|
||||||
return
|
return
|
||||||
@ -701,7 +702,7 @@ def _real_extract(self, url):
|
|||||||
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 = unescapeHTML(mobj.group('title').decode('utf-8'))
|
video_title = unescapeHTML(mobj.group('title'))
|
||||||
|
|
||||||
video_uploader = None
|
video_uploader = None
|
||||||
mobj = re.search(r'(?im)<span class="owner[^\"]+?">[^<]+?<a [^>]+?>([^<]+?)</a>', webpage)
|
mobj = re.search(r'(?im)<span class="owner[^\"]+?">[^<]+?<a [^>]+?>([^<]+?)</a>', webpage)
|
||||||
@ -721,12 +722,12 @@ def _real_extract(self, url):
|
|||||||
video_upload_date = mobj.group(3) + mobj.group(2) + mobj.group(1)
|
video_upload_date = mobj.group(3) + mobj.group(2) + mobj.group(1)
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
'id': video_id.decode('utf-8'),
|
'id': video_id,
|
||||||
'url': video_url.decode('utf-8'),
|
'url': video_url,
|
||||||
'uploader': video_uploader.decode('utf-8'),
|
'uploader': video_uploader,
|
||||||
'upload_date': video_upload_date,
|
'upload_date': video_upload_date,
|
||||||
'title': video_title,
|
'title': video_title,
|
||||||
'ext': video_extension.decode('utf-8'),
|
'ext': video_extension,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user