projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5cb9c31
)
Fix xvideo IE in Python 3
author
Philipp Hagemeister
<phihag@phihag.de>
Sat, 15 Dec 2012 16:50:45 +0000
(17:50 +0100)
committer
Philipp Hagemeister
<phihag@phihag.de>
Sat, 15 Dec 2012 16:50:45 +0000
(17:50 +0100)
youtube_dl/InfoExtractors.py
patch
|
blob
|
history
diff --git
a/youtube_dl/InfoExtractors.py
b/youtube_dl/InfoExtractors.py
index b7fedabb2efe521fb3c75830c5d7883027427fa5..1f5e189679989a030e1a11c31123a544e0e8ed06 100644
(file)
--- a/
youtube_dl/InfoExtractors.py
+++ b/
youtube_dl/InfoExtractors.py
@@
-2770,13
+2770,14
@@
class XVideosIE(InfoExtractor):
if mobj is None:
self._downloader.trouble(u'ERROR: invalid URL: %s' % url)
return
if mobj is None:
self._downloader.trouble(u'ERROR: invalid URL: %s' % url)
return
- video_id = mobj.group(1)
.decode('utf-8')
+ video_id = mobj.group(1)
self.report_webpage(video_id)
request = compat_urllib_request.Request(r'http://www.xvideos.com/video' + video_id)
try:
self.report_webpage(video_id)
request = compat_urllib_request.Request(r'http://www.xvideos.com/video' + video_id)
try:
- webpage = compat_urllib_request.urlopen(request).read()
+ webpage_bytes = compat_urllib_request.urlopen(request).read()
+ webpage = webpage_bytes.decode('utf-8', 'replace')
except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
self._downloader.trouble(u'ERROR: unable to download video webpage: %s' % compat_str(err))
return
except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
self._downloader.trouble(u'ERROR: unable to download video webpage: %s' % compat_str(err))
return
@@
-2789,7
+2790,7
@@
class XVideosIE(InfoExtractor):
if mobj is None:
self._downloader.trouble(u'ERROR: unable to extract video url')
return
if mobj is None:
self._downloader.trouble(u'ERROR: unable to extract video url')
return
- video_url = compat_urllib_parse.unquote(mobj.group(1)
.decode('utf-8')
)
+ video_url = compat_urllib_parse.unquote(mobj.group(1))
# Extract title
# Extract title
@@
-2797,7
+2798,7
@@
class XVideosIE(InfoExtractor):
if mobj is None:
self._downloader.trouble(u'ERROR: unable to extract video title')
return
if mobj is None:
self._downloader.trouble(u'ERROR: unable to extract video title')
return
- video_title = mobj.group(1)
.decode('utf-8')
+ video_title = mobj.group(1)
# Extract video thumbnail
# Extract video thumbnail
@@
-2805,7
+2806,7
@@
class XVideosIE(InfoExtractor):
if mobj is None:
self._downloader.trouble(u'ERROR: unable to extract video thumbnail')
return
if mobj is None:
self._downloader.trouble(u'ERROR: unable to extract video thumbnail')
return
- video_thumbnail = mobj.group(0)
.decode('utf-8')
+ video_thumbnail = mobj.group(0)
info = {
'id': video_id,
info = {
'id': video_id,