mirror of
https://git.lecygnenoir.info/LecygneNoir/prismedia.git
synced 2025-10-03 09:29:16 +02:00
Add nsfw option for Peertube only, YT api does not support it at the moment
This commit is contained in:
parent
0295402194
commit
7c12bcbc31
3 changed files with 12 additions and 9 deletions
|
@ -35,6 +35,7 @@ Options:
|
||||||
--cca License should be CreativeCommon Attribution (affects Youtube upload only)
|
--cca License should be CreativeCommon Attribution (affects Youtube upload only)
|
||||||
-p, --privacy=STRING Choose between public, unlisted or private. [default: private]
|
-p, --privacy=STRING Choose between public, unlisted or private. [default: private]
|
||||||
--disable-comments Disable comments (Peertube only) [default: comments are enabled]
|
--disable-comments Disable comments (Peertube only) [default: comments are enabled]
|
||||||
|
--nsfw Set the video as NSFW (Peertube only as YT API does not support) [default: video is not restricted]
|
||||||
-h --help Show this help.
|
-h --help Show this help.
|
||||||
--version Show version.
|
--version Show version.
|
||||||
|
|
||||||
|
@ -58,8 +59,8 @@ Categories:
|
||||||
- [x] categories
|
- [x] categories
|
||||||
- [x] license: cca or not, affect only Youtube as Peertube uses Attribution by design
|
- [x] license: cca or not, affect only Youtube as Peertube uses Attribution by design
|
||||||
- [x] privacy (between public, unlisted or private)
|
- [x] privacy (between public, unlisted or private)
|
||||||
- [x] enabling/disabling comment (Peertube only as Youtube API has no option for that)
|
- [x] enabling/disabling comment (Peertube only as Youtube API does not support it)
|
||||||
- [ ] nsfw
|
- [x] nsfw (Peertube only as Youtube API does not support it)
|
||||||
- [ ] thumbnail/preview
|
- [ ] thumbnail/preview
|
||||||
- [ ] Use a config file (NFO) file to retrieve videos arguments
|
- [ ] Use a config file (NFO) file to retrieve videos arguments
|
||||||
- [ ] Record and forget: put the video in a directory, and the script uploads it for you
|
- [ ] Record and forget: put the video in a directory, and the script uploads it for you
|
||||||
|
|
|
@ -64,7 +64,7 @@ def upload_video(oauth, config, options):
|
||||||
("licence", "1"),
|
("licence", "1"),
|
||||||
("description", options.get('--description') or "default description"),
|
("description", options.get('--description') or "default description"),
|
||||||
# look at the list numbers at /videos/privacies
|
# look at the list numbers at /videos/privacies
|
||||||
("nsfw", "0"),
|
("nsfw", str(int(options.get('--nsfw')) or "0")),
|
||||||
("channelId", get_userinfo()),
|
("channelId", get_userinfo()),
|
||||||
("videofile", get_videofile(path))
|
("videofile", get_videofile(path))
|
||||||
]
|
]
|
||||||
|
|
|
@ -10,13 +10,14 @@ Usage:
|
||||||
prismedia_upload.py --version
|
prismedia_upload.py --version
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
--name=NAME Name of the video to upload. [default: video filename]
|
--name=NAME Name of the video to upload. (default to video filename)
|
||||||
-d, --description=STRING Description of the video. [default: default description]
|
-d, --description=STRING Description of the video. [default: default description]
|
||||||
-t, --tags=STRING Tags for the video. comma separated
|
-t, --tags=STRING Tags for the video. comma separated
|
||||||
-c, --category=STRING Category for the videos, see below. [ default: Films]
|
-c, --category=STRING Category for the videos, see below. [default: Films]
|
||||||
--cca License should be CreativeCommon Attribution (affects Youtube upload only)
|
--cca License should be CreativeCommon Attribution (affects Youtube upload only)
|
||||||
-p, --privacy=STRING Choose between public, unlisted or private. [default: private]
|
-p, --privacy=STRING Choose between public, unlisted or private. [default: private]
|
||||||
--disable-comments Disable comments (Peertube only) [default: comments are enabled]
|
--disable-comments Disable comments (Peertube only as YT API does not support) [default: comments are enabled]
|
||||||
|
--nsfw Set the video as NSFW (Peertube only as YT API does not support) [default: video is not restricted]
|
||||||
-h --help Show this help.
|
-h --help Show this help.
|
||||||
--version Show version.
|
--version Show version.
|
||||||
|
|
||||||
|
@ -44,13 +45,13 @@ import pt_upload
|
||||||
try:
|
try:
|
||||||
from schema import Schema, And, Or, Optional, SchemaError
|
from schema import Schema, And, Or, Optional, SchemaError
|
||||||
except ImportError:
|
except ImportError:
|
||||||
exit('This program requires that the `schema` data-validation library'
|
e('This program requires that the `schema` data-validation library'
|
||||||
' is installed: \n'
|
' is installed: \n'
|
||||||
'see https://github.com/halst/schema\n')
|
'see https://github.com/halst/schema\n')
|
||||||
try:
|
try:
|
||||||
import magic
|
import magic
|
||||||
except ImportError:
|
except ImportError:
|
||||||
exit('This program requires that the `python-magic` library'
|
e('This program requires that the `python-magic` library'
|
||||||
' is installed, NOT the Python bindings to libmagic API \n'
|
' is installed, NOT the Python bindings to libmagic API \n'
|
||||||
'see https://github.com/ahupp/python-magic\n')
|
'see https://github.com/ahupp/python-magic\n')
|
||||||
|
|
||||||
|
@ -97,6 +98,7 @@ if __name__ == '__main__':
|
||||||
Optional('--privacy'): Or(None, And(str, validatePrivacy, error="Please use recognized privacy between public, unlisted or private")),
|
Optional('--privacy'): Or(None, And(str, validatePrivacy, error="Please use recognized privacy between public, unlisted or private")),
|
||||||
Optional('--cca'): bool,
|
Optional('--cca'): bool,
|
||||||
Optional('--disable-comments'): bool,
|
Optional('--disable-comments'): bool,
|
||||||
|
Optional('--nsfw'): bool,
|
||||||
'--help': bool,
|
'--help': bool,
|
||||||
'--version': bool
|
'--version': bool
|
||||||
})
|
})
|
||||||
|
@ -104,7 +106,7 @@ if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
options = schema.validate(options)
|
options = schema.validate(options)
|
||||||
except SchemaError as e:
|
except SchemaError as e:
|
||||||
exit(e)
|
e(e)
|
||||||
|
|
||||||
# yt_upload.run(options)
|
# yt_upload.run(options)
|
||||||
pt_upload.run(options)
|
pt_upload.run(options)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue