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
This commit is contained in:
parent
04f3d551a0
commit
213c31ae16
2 changed files with 9 additions and 1 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue