Browse Source

Validate options schema after parsing NFO, to validate data imported from NFO (sanity checks)

master
LecygneNoir 6 years ago
parent
commit
605f1a8d67
2 changed files with 5 additions and 4 deletions
  1. +2
    -1
      nfo_example.txt
  2. +3
    -3
      prismedia_upload.py

+ 2
- 1
nfo_example.txt View File

@ -13,4 +13,5 @@ category = Films
cca = True
privacy = private
disable-comments = True
nsfw = True
nsfw = True
platform = youtub

+ 3
- 3
prismedia_upload.py View File

@ -63,7 +63,7 @@ except ImportError:
' is installed, NOT the Python bindings to libmagic API \n'
'see https://github.com/ahupp/python-magic\n')
VERSION = "prismedia 0.3"
VERSION = "prismedia v0.3"
VALID_PRIVACY_STATUSES = ('public', 'private', 'unlisted')
VALID_CATEGORIES = (
"music", "films", "vehicles",
@ -145,13 +145,13 @@ if __name__ == '__main__':
'--version': bool
})
options = utils.parseNFO(options)
try:
options = schema.validate(options)
except SchemaError as e:
exit(e)
options = utils.parseNFO(options)
if options.get('--platform') is None or "youtube" in options.get('--platform'):
yt_upload.run(options)
if options.get('--platform') is None or "peertube" in options.get('--platform'):

Loading…
Cancel
Save