[escapist] Filter video differently (Fixes #4919)
authorPhilipp Hagemeister <phihag@phihag.de>
Tue, 10 Feb 2015 14:55:51 +0000 (15:55 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Tue, 10 Feb 2015 14:55:51 +0000 (15:55 +0100)
youtube_dl/extractor/common.py
youtube_dl/extractor/escapist.py

index 382e846c5c73fc352d45f43a072379ff27f2e54c..8d71494b4994dc2d8908acb430950e33b594fc32 100644 (file)
@@ -271,7 +271,7 @@ class InfoExtractor(object):
             raise
         except compat_http_client.IncompleteRead as e:
             raise ExtractorError('A network error has occured.', cause=e, expected=True)
-        except (KeyError,) as e:
+        except (KeyError, StopIteration) as e:
             raise ExtractorError('An extractor error has occured.', cause=e)
 
     def set_downloader(self, downloader):
index 98b6982770d95e1c10b59b5d4e3970a2ba0bf99c..4303feccdaedd865e2c769a282173de6a4d5ffce 100644 (file)
@@ -54,8 +54,11 @@ class EscapistIE(InfoExtractor):
                 transform_source=js_to_json)
 
             playlist = config['playlist']
+            video_url = next(
+                p['url'] for p in playlist
+                if p.get('eventCategory') == 'Video')
             formats.append({
-                'url': playlist[1]['url'],
+                'url': video_url,
                 'format_id': name,
                 'quality': quality,
             })