mirror of
https://git.lecygnenoir.info/LecygneNoir/prismedia.git
synced 2025-10-03 09:29:16 +02:00
Add new feature to force compatibility tag with Mastodon publication (peertube)
This commit is contained in:
parent
768bbb0215
commit
ac6db56355
5 changed files with 43 additions and 6 deletions
|
@ -68,14 +68,17 @@ def upload_video(oauth, secret, options):
|
|||
|
||||
if options.get('--tags'):
|
||||
tags = options.get('--tags').split(',')
|
||||
for strtags in tags:
|
||||
for strtag in tags:
|
||||
# Empty tag crashes Peertube, so skip them
|
||||
if strtags == "":
|
||||
if strtag == "":
|
||||
continue
|
||||
# Tag more than 30 chars crashes Peertube, so exit and check tags
|
||||
if len(strtags) >= 30:
|
||||
if len(strtag) >= 30:
|
||||
exit("Sorry, Peertube does not support tag with more than 30 characters, please reduce your tag size")
|
||||
fields.append(("tags", strtags))
|
||||
# If Mastodon compatibility is enabled, clean tags from special characters
|
||||
if options.get('--mt'):
|
||||
strtag = utils.mastodonTag(strtag)
|
||||
fields.append(("tags", strtag))
|
||||
|
||||
if options.get('--category'):
|
||||
fields.append(("category", str(utils.getCategory(options.get('--category'), 'peertube'))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue