]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
don't use selection by attribute
authorPeter Rowlands <peter@pmrowla.com>
Sun, 8 May 2016 01:33:17 +0000 (10:33 +0900)
committerPeter Rowlands <peter@pmrowla.com>
Sun, 8 May 2016 01:33:17 +0000 (10:33 +0900)
youtube_dl/extractor/afreecatv.py

index 527386be3c4b1ff15551644a91ef5b5936d1b78b..0fcbea0d168dbfca2bcf0d78f9d5a36f766fbd55 100644 (file)
@@ -95,8 +95,10 @@ class AfreecaTVIE(InfoExtractor):
         thumbnail = xpath_text(video_xml, './track/titleImage', 'thumbnail')
 
         entries = []
         thumbnail = xpath_text(video_xml, './track/titleImage', 'thumbnail')
 
         entries = []
-        for i, video_file in enumerate(video_xml.findall('./track/video/file[@key]')):
-            video_key = self.parse_video_key(video_file.get('key'))
+        for i, video_file in enumerate(video_xml.findall('./track/video/file')):
+            video_key = self.parse_video_key(video_file.get('key', ''))
+            if not video_key:
+                continue
             entries.append({
                 'id': '%s_%s' % (video_id, video_key.get('part', i + 1)),
                 'title': title,
             entries.append({
                 'id': '%s_%s' % (video_id, video_key.get('part', i + 1)),
                 'title': title,