aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/InfoExtractors.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2012-12-15 17:57:13 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2012-12-15 17:57:13 +0100
commite2a8ff24a9427b8402ee7771cc145a307811ed30 (patch)
tree3844d34ceb45b42f8420aa2d05d87f4287e14454 /youtube_dl/InfoExtractors.py
parent8588a86f9e730b467d203124e9607b4cb1c22a5c (diff)
Fix YoukuIE in Python3 (and in general)
Diffstat (limited to 'youtube_dl/InfoExtractors.py')
-rw-r--r--youtube_dl/InfoExtractors.py11
1 files changed, 2 insertions, 9 deletions
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