Browse Source

Add a check to avoid uploading on Peertube with more than 5 tags (see #48)

pull/51/head
LecygneNoir 3 years ago
parent
commit
5160e9e68d
2 changed files with 11 additions and 3 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +10
    -3
      prismedia/pt_upload.py

+ 1
- 0
CHANGELOG.md View File

@ -5,6 +5,7 @@
### Fixes
- Fix a typo in log (missing space when displaying thumbnail) (see #47)
- Add pagination when searching playlist in Peertube as default pagination show only 14 playlists (see #41)
- Add a check to avoid uploading video on Peertube with more than 5 tags (see #48)
## v0.10.1

+ 10
- 3
prismedia/pt_upload.py View File

@ -209,14 +209,21 @@ def upload_video(oauth, secret, options):
if options.get('--tags'):
tags = options.get('--tags').split(',')
tag_number = 0
for strtag in tags:
tag_number = tag_number + 1
# Empty tag crashes Peertube, so skip them
if strtag == "":
continue
# Tag more than 30 chars crashes Peertube, so exit and check tags
# Tag more than 30 chars crashes Peertube, so skip tags
if len(strtag) >= 30:
logger.error("Peertube: Sorry, Peertube does not support tag with more than 30 characters, please reduce tag: " + strtag)
logger.error("Peertube: Meanwhile, this tag will be skipped")
logger.warning("Peertube: Sorry, Peertube does not support tag with more than 30 characters, please reduce tag: " + strtag)
logger.warning("Peertube: Meanwhile, this tag will be skipped")
continue
# Peertube supports only 5 tags at the moment
if tag_number > 5:
logger.warning("Peertube: Sorry, Peertube support 5 tags max, additional tag will be skipped")
logger.warning("Peertube: Skipping tag " + strtag)
continue
fields.append(("tags[]", strtag))

Loading…
Cancel
Save