From: Philipp Hagemeister Date: Sat, 15 Dec 2012 16:57:13 +0000 (+0100) Subject: Fix YoukuIE in Python3 (and in general) X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=e2a8ff24a9427b8402ee7771cc145a307811ed30;p=youtube-dl.git Fix YoukuIE in Python3 (and in general) --- diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py index 1f5e18967..fd977d2d9 100644 --- a/youtube_dl/InfoExtractors.py +++ b/youtube_dl/InfoExtractors.py @@ -3372,15 +3372,8 @@ class YoukuIE(InfoExtractor): fileid = config['data'][0]['streamfileids'][format] - seg_number = len(config['data'][0]['segs'][format]) - - keys=[] - for i in xrange(seg_number): - keys.append(config['data'][0]['segs'][format][i]['k']) - - #TODO check error - #youku only could be viewed from mainland china - except: + keys = [s['k'] for s in config['data'][0]['segs'][format]] + except (ValueError, KeyError): self._downloader.trouble(u'ERROR: unable to extract info section') return