Add an "epoch" keyword to the output template
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>
Mon, 4 May 2009 17:31:00 +0000 (19:31 +0200)
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sun, 31 Oct 2010 10:24:12 +0000 (11:24 +0100)
youtube-dl

index 2708fe4e7acb3aa1b34ec847f64b82e5ba7a42ce..db9510f7be78ab3ec7e18f57b1ea39dc74a3643e 100755 (executable)
@@ -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))