Skip to content

A feature-rich command-line audio/video downloader

More Youku Python 3 fixing

Philipp Hagemeister8f6f40d99180
diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py
index fd977d2d99..b1ede697a7 100644
--- a/youtube_dl/InfoExtractors.py
+++ b/youtube_dl/InfoExtractors.py
@@ -3349,7 +3349,8 @@ class YoukuIE(InfoExtractor):
self.report_extraction(video_id)
try:
- config = json.loads(jsondata)
+ jsonstr = jsondata.decode('utf-8')
+ config = json.loads(jsonstr)
video_title = config['data'][0]['title']
seed = config['data'][0]['seed']
@@ -3373,7 +3374,7 @@ class YoukuIE(InfoExtractor):
fileid = config['data'][0]['streamfileids'][format]
keys = [s['k'] for s in config['data'][0]['segs'][format]]
- except (ValueError, KeyError):
+ except (UnicodeDecodeError, ValueError, KeyError):
self._downloader.trouble(u'ERROR: unable to extract info section')
return