Browse Source

Add some protection for tags (no empty tag, no tag with more than 30 chars)

develop
LecygneNoir 6 years ago
parent
commit
54beb8ee7e
2 changed files with 9 additions and 1 deletions
  1. +3
    -1
      README.md
  2. +6
    -0
      lib/pt_upload.py

+ 3
- 1
README.md View File

@ -112,14 +112,16 @@ Categories:
- [x] Peertube upload
- Support of all videos arguments (description, tags, category, licence, ...)
- [x] description
- [x] tags
- [x] tags (no more than 30 characters per tag as Peertube does not support it)
- [x] categories
- [x] license: cca or not (Youtube only as Peertube uses Attribution by design)
- [x] privacy (between public, unlisted or private)
- [x] enabling/disabling comment (Peertube only as Youtube API does not support it)
- [x] nsfw (Peertube only as Youtube API does not support it)
- [ ] set default language
- ~~thumbnail/preview~~ Canceled, waiting for Youtube's API support
- [x] Use a config file (NFO) file to retrieve videos arguments
- [ ] Allow to choose peertube or youtube upload (to resume failed upload for example)
- [ ] Record and forget: put the video in a directory, and the script uploads it for you
- [ ] Usable on Desktop (Linux and/or Windows and/or MacOS)
- [ ] Graphical User Interface

+ 6
- 0
lib/pt_upload.py View File

@ -69,6 +69,12 @@ def upload_video(oauth, secret, options):
if options.get('--tags'):
tags = options.get('--tags').split(',')
for strtags in tags:
# Empty tag crashes Peertube, so skip them
if strtags == "":
continue
# Tag more than 30 chars crashes Peertube, so exit and check tags
if len(strtags) >= 30:
exit("Sorry, Peertube does not support tag with more than 30 characters, please reduce your tag size")
fields.append(("tags", strtags))
if options.get('--category'):

Loading…
Cancel
Save