aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/__init__.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2017-01-28 23:57:56 +0700
committerSergey M․ <dstftw@gmail.com>2017-01-29 00:00:45 +0700
commit1a241a2d02e2507219e81d7b18c18f10937ae6e7 (patch)
treedad14d46ae2ba2f492cdba7b8839d4b1aed3f681 /youtube_dl/__init__.py
parentacbb2374bce27eda16764b80832f88cf833a51e5 (diff)
[options] Refactor autonumber options and add validation (closes #727, closes #2702, closes #9362)
Diffstat (limited to 'youtube_dl/__init__.py')
-rw-r--r--youtube_dl/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py
index 577bc880f..2b156342a 100644
--- a/youtube_dl/__init__.py
+++ b/youtube_dl/__init__.py
@@ -133,6 +133,12 @@ def _real_main(argv=None):
parser.error('TV Provider account username missing\n')
if opts.outtmpl is not None and (opts.usetitle or opts.autonumber or opts.useid):
parser.error('using output template conflicts with using title, video ID or auto number')
+ if opts.autonumber_size is not None:
+ if opts.autonumber_size <= 0:
+ parser.error('auto number size must be positive')
+ if opts.autonumber_start is not None:
+ if opts.autonumber_start < 0:
+ parser.error('auto number start must be positive or 0')
if opts.usetitle and opts.useid:
parser.error('using title conflicts with using video ID')
if opts.username is not None and opts.password is None: