浏览代码

[YoutubeDL] Skip non-relevant field types when building output template

Sergey M․ 9 年之前
父节点
当前提交
f0e14fdd43
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      youtube_dl/YoutubeDL.py

+ 1 - 1
youtube_dl/YoutubeDL.py

@@ -580,7 +580,7 @@ class YoutubeDL(object):
                 is_id=(k == 'id'))
                 is_id=(k == 'id'))
             template_dict = dict((k, sanitize(k, v))
             template_dict = dict((k, sanitize(k, v))
                                  for k, v in template_dict.items()
                                  for k, v in template_dict.items()
-                                 if v is not None)
+                                 if v is not None and not isinstance(v, (list, tuple, dict)))
             template_dict = collections.defaultdict(lambda: 'NA', template_dict)
             template_dict = collections.defaultdict(lambda: 'NA', template_dict)
 
 
             outtmpl = self.params.get('outtmpl', DEFAULT_OUTTMPL)
             outtmpl = self.params.get('outtmpl', DEFAULT_OUTTMPL)