summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Rowlands <peter@pmrowla.com>2016-05-08 10:02:48 +0900
committerPeter Rowlands <peter@pmrowla.com>2016-05-08 10:02:48 +0900
commit370d4eb8ad3d9d092fc5eb116509eaf4a3e83177 (patch)
treef4d3c460e045659864defb9919d1206204a914f6
parent3452c3a27c2bfd278746314cda4247c2226a35f3 (diff)
downloadyoutube-dl-370d4eb8ad3d9d092fc5eb116509eaf4a3e83177.tar.gz
youtube-dl-370d4eb8ad3d9d092fc5eb116509eaf4a3e83177.tar.xz
youtube-dl-370d4eb8ad3d9d092fc5eb116509eaf4a3e83177.zip
use stricter file selector
in case of empty in case of empty ./track/video/file entries
-rw-r--r--youtube_dl/extractor/afreecatv.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/extractor/afreecatv.py b/youtube_dl/extractor/afreecatv.py
index b90095881..527386be3 100644
--- a/youtube_dl/extractor/afreecatv.py
+++ b/youtube_dl/extractor/afreecatv.py
@@ -95,7 +95,7 @@ class AfreecaTVIE(InfoExtractor):
         thumbnail = xpath_text(video_xml, './track/titleImage', 'thumbnail')
 
         entries = []
-        for i, video_file in enumerate(video_xml.findall('./track/video/file')):
+        for i, video_file in enumerate(video_xml.findall('./track/video/file[@key]')):
             video_key = self.parse_video_key(video_file.get('key'))
             entries.append({
                 'id': '%s_%s' % (video_id, video_key.get('part', i + 1)),
@@ -119,7 +119,7 @@ class AfreecaTVIE(InfoExtractor):
             info['entries'] = entries
         elif len(entries) == 1:
             info['url'] = entries[0]['url']
-            info['upload_date'] = entries[0]['upload_date']
+            info['upload_date'] = entries[0].get('upload_date')
         else:
             raise ExtractorError(
                 'No files found for the specified AfreecaTV video, either'