added --autonumber-start NUMBER as a command line option to be able to offset the index at which autonumber formats filenames

This commit is contained in:
Costy Petrisor 2016-05-01 12:34:11 +00:00 committed by Sergey M․
parent 4edeac5bfa
commit acbb2374bc
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D
3 changed files with 6 additions and 1 deletions

View file

@ -584,7 +584,7 @@ class YoutubeDL(object):
if autonumber_size is None:
autonumber_size = 5
autonumber_templ = '%0' + str(autonumber_size) + 'd'
template_dict['autonumber'] = autonumber_templ % self._num_downloads
template_dict['autonumber'] = autonumber_templ % (self.params.get('autonumber_start', 1) - 1 + self._num_downloads)
if template_dict.get('playlist_index') is not None:
template_dict['playlist_index'] = '%0*d' % (len(str(template_dict['n_entries'])), template_dict['playlist_index'])
if template_dict.get('resolution') is None: