From 77bcda7a79524c1d2b6f0dc1c0ebdf775fb0c968 Mon Sep 17 00:00:00 2001 From: Zykino Date: Sat, 18 Jan 2020 15:51:42 +0100 Subject: [PATCH] Add a debug option. Upload to Peertube before Youtube. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An upload to Peertube may be slower or have a slower encoding on the server. Also why not give a preference to the open source host. As it won’t slow Youtube only uploads. --- prismedia_upload.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/prismedia_upload.py b/prismedia_upload.py index 5c7c99f..9c6b96e 100755 --- a/prismedia_upload.py +++ b/prismedia_upload.py @@ -13,6 +13,7 @@ Usage: Options: -f, --file=STRING Path to the video file to upload in mp4 --name=NAME Name of the video to upload. (default to video filename) + --debug Show some debug informations like the option actually used (default: no debug info) -d, --description=STRING Description of the video. (default: default description) -t, --tags=STRING Tags for the video. comma separated. WARN: tags with space and special characters (!, ', ", ?, ...) @@ -110,7 +111,7 @@ VALID_CATEGORIES = ( "how to", "education", "activism", "science & technology", "science", "technology", "animals" ) -VALID_PLATFORM = ('youtube', 'peertube') +VALID_PLATFORM = ('youtube', 'peertube', 'none') VALID_LANGUAGES = ('arabic', 'english', 'french', 'german', 'hindi', 'italian', 'japanese', 'korean', 'mandarin', @@ -209,6 +210,7 @@ if __name__ == '__main__': validatePublish, error="DATE should be the form YYYY-MM-DDThh:mm:ss and has to be in the future") ), + Optional('--debug'): bool, Optional('--cca'): bool, Optional('--disable-comments'): bool, Optional('--nsfw'): bool, @@ -233,7 +235,11 @@ if __name__ == '__main__': except SchemaError as e: exit(e) - if options.get('--platform') is None or "youtube" in options.get('--platform'): - yt_upload.run(options) - if options.get('--platform') is None or "peertube" in options.get('--platform'): - pt_upload.run(options) + if options.get('--debug'): + print(sys.version) + print(options) + + #if options.get('--platform') is None or "peertube" in options.get('--platform'): + # pt_upload.run(options) + #if options.get('--platform') is None or "youtube" in options.get('--platform'): + # yt_upload.run(options)