aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/FileDownloader.py
diff options
context:
space:
mode:
authorStanislav Kupryakhin <st.kupr@gmail.com>2013-04-02 11:40:07 +0700
committerPhilipp Hagemeister <phihag@phihag.de>2013-04-11 10:53:57 +0200
commit213c31ae16641ed2df61f0abbd7ea032267b2222 (patch)
treeb9472021903f7a67bcd7c0569f914e03a02ec685 /youtube_dl/FileDownloader.py
parent04f3d551a0b49ffede5467138d56cb3fceacaa1d (diff)
Added option --autonumber-size:
Specifies the number of digits in %(autonumber)s when it is present in output filename template or --autonumber option is given
Diffstat (limited to 'youtube_dl/FileDownloader.py')
-rw-r--r--youtube_dl/FileDownloader.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py
index e801db00a..7731db17f 100644
--- a/youtube_dl/FileDownloader.py
+++ b/youtube_dl/FileDownloader.py
@@ -388,7 +388,9 @@ class FileDownloader(object):
template_dict = dict(info_dict)
template_dict['epoch'] = int(time.time())
- template_dict['autonumber'] = u'%05d' % self._num_downloads
+ autonumber_size = self.params.get('autonumber_size', 5)
+ autonumber_templ = u'%0' + str(autonumber_size) + u'd'
+ template_dict['autonumber'] = autonumber_templ % self._num_downloads
sanitize = lambda k,v: sanitize_filename(
u'NA' if v is None else compat_str(v),