mirror of
https://git.lecygnenoir.info/LecygneNoir/prismedia.git
synced 2025-10-03 09:29:16 +02:00
Add some protection for tags (no empty tag, no tag with more than 30 chars)
This commit is contained in:
parent
6be996b9a3
commit
54beb8ee7e
2 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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…
Add table
Add a link
Reference in a new issue