浏览代码

Add an "epoch" keyword to the output template

Ricardo Garcia 16 年之前
父节点
当前提交
ad274509aa
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      youtube-dl

+ 3 - 1
youtube-dl

@@ -260,7 +260,9 @@ class FileDownloader(object):
 			return
 			return
 
 
 		try:
 		try:
-			filename = self.params['outtmpl'] % info_dict
+			template_dict = dict(info_dict)
+			template_dict['epoch'] = unicode(long(time.time()))
+			filename = self.params['outtmpl'] % template_dict
 			self.report_destination(filename)
 			self.report_destination(filename)
 		except (ValueError, KeyError), err:
 		except (ValueError, KeyError), err:
 			self.trouble('ERROR: invalid output template or system charset: %s' % str(err))
 			self.trouble('ERROR: invalid output template or system charset: %s' % str(err))