about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>2009-05-04 19:31:00 +0200
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>2010-10-31 11:24:12 +0100
commitad274509aa1eba53d41f15e5226b81419991af64 (patch)
treed9e7bee2d422d7e616efbc602c55beab772bd935
parentd09744d0553650065195a212a826e4267bcfed7b (diff)
downloadyoutube-dl-ad274509aa1eba53d41f15e5226b81419991af64.tar.gz
youtube-dl-ad274509aa1eba53d41f15e5226b81419991af64.tar.xz
youtube-dl-ad274509aa1eba53d41f15e5226b81419991af64.zip
Add an "epoch" keyword to the output template
-rwxr-xr-xyoutube-dl4
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube-dl b/youtube-dl
index 2708fe4e7..db9510f7b 100755
--- a/youtube-dl
+++ b/youtube-dl
@@ -260,7 +260,9 @@ class FileDownloader(object):
 			return
 
 		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)
 		except (ValueError, KeyError), err:
 			self.trouble('ERROR: invalid output template or system charset: %s' % str(err))