|
|
@ -49,6 +49,7 @@ Options: |
|
|
|
If the playlist is not found, spawn an error except if --playlistCreate is set. |
|
|
|
--playlistCreate Create the playlist if not exists. (default do not create) |
|
|
|
Only relevant if --playlist is set. |
|
|
|
--progress=STRING Set the progress bar view, one of percentage, bigFile, accurate. |
|
|
|
-h --help Show this help. |
|
|
|
--version Show version. |
|
|
|
|
|
|
@ -150,6 +151,7 @@ VALID_LANGUAGES = ('arabic', 'english', 'french', |
|
|
|
'german', 'hindi', 'italian', |
|
|
|
'japanese', 'korean', 'mandarin', |
|
|
|
'portuguese', 'punjabi', 'russian', 'spanish') |
|
|
|
VALID_PROGRESS = ('percentage', 'bigfile', 'accurate') |
|
|
|
|
|
|
|
|
|
|
|
def validateVideo(path): |
|
|
@ -235,6 +237,14 @@ def validateLogLevel(loglevel): |
|
|
|
return True |
|
|
|
|
|
|
|
|
|
|
|
def validateProgress(progress): |
|
|
|
for prgs in progress.split(','): |
|
|
|
if prgs.lower().replace(" ", "") not in VALID_PROGRESS: |
|
|
|
return False |
|
|
|
|
|
|
|
return True |
|
|
|
|
|
|
|
|
|
|
|
def _optionnalOrStrict(key, scope, error): |
|
|
|
option = key.replace('-', '') |
|
|
|
option = option[0].upper() + option[1:] |
|
|
@ -385,6 +395,7 @@ def main(): |
|
|
|
Optional('--channelCreate'): bool, |
|
|
|
Optional('--playlist'): Or(None, str), |
|
|
|
Optional('--playlistCreate'): bool, |
|
|
|
Optional('--progress'): Or(None, And(str, validateProgress, error="Sorry, progress visualisation not supported")), |
|
|
|
'--help': bool, |
|
|
|
'--version': bool, |
|
|
|
# This allow to return all other options for further use: https://github.com/keleshev/schema#extra-keys |
|
|
|