From: Filippo Valsorda Date: Tue, 27 Nov 2012 22:20:32 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/master' into IE_cleanup X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=youtube-dl;a=commitdiff_plain;h=c63cc10ffaeb2e5ab20b78f871bef8ca5492c78c Merge remote-tracking branch 'origin/master' into IE_cleanup Conflicts: youtube_dl/FileDownloader.py --- c63cc10ffaeb2e5ab20b78f871bef8ca5492c78c diff --cc youtube_dl/FileDownloader.py index a7997c4f2,4e9b55f49..870c82272 --- a/youtube_dl/FileDownloader.py +++ b/youtube_dl/FileDownloader.py @@@ -325,9 -327,10 +327,13 @@@ class FileDownloader(object) """Generate the output filename.""" try: template_dict = dict(info_dict) - template_dict['epoch'] = unicode(int(time.time())) - template_dict['autonumber'] = unicode('%05d' % self._num_downloads) ++ + template_dict['epoch'] = int(time.time()) + template_dict['autonumber'] = u'%05d' % self._num_downloads + + template_dict = dict((key, u'NA' if val is None else val) for key, val in template_dict.items()) + template_dict = dict((k, sanitize_filename(u(v), self.params.get('restrictfilenames'))) for k,v in template_dict.items()) ++ filename = self.params['outtmpl'] % template_dict return filename except (ValueError, KeyError), err: