From f365eb1089302fc26cc5bad7c543466c653ead42 Mon Sep 17 00:00:00 2001 From: Zykino Date: Sun, 9 Sep 2018 17:21:59 +0200 Subject: [PATCH 1/4] fix README with the version of python used and adding a missing dependency --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2197a95..713bf4c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Prismedia -A scripting way to upload videos to peertube and youtube +A scripting way to upload videos to peertube and youtube written in python2 ## Dependencies Search in your package manager, otherwise use ``pip install --upgrade`` @@ -11,6 +11,7 @@ Search in your package manager, otherwise use ``pip install --upgrade`` - docopt - schema - python-magic + - python-magic-bin - requests-toolbelt - tzlocal @@ -60,12 +61,12 @@ Simply upload a video: ``` ./prismedia_upload.py --file="yourvideo.mp4" -``` +``` Specify description and tags: -``` +``` ./prismedia_upload.py --file="yourvideo.mp4" -d "My supa description" -t "tag1,tag2,foo" ``` @@ -168,5 +169,5 @@ Languages: If your server uses peertube before 1.0.0-beta4, use the version inside tag 1.0.0-beta3! -## Sources -inspired by [peeror](https://git.drycat.fr/rigelk/Peeror) and [youtube-upload](https://github.com/tokland/youtube-upload) \ No newline at end of file +## Sources +inspired by [peeror](https://git.drycat.fr/rigelk/Peeror) and [youtube-upload](https://github.com/tokland/youtube-upload) From 844173f326d0a9849de5e0dc1269b1e8316e33f7 Mon Sep 17 00:00:00 2001 From: Zykino Date: Sun, 9 Sep 2018 17:29:09 +0200 Subject: [PATCH 2/4] fix OAuth URL for peertube --- peertube_secret.sample | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/peertube_secret.sample b/peertube_secret.sample index 5051bcb..f2fa723 100644 --- a/peertube_secret.sample +++ b/peertube_secret.sample @@ -1,5 +1,5 @@ # This information is obtained upon registration/once logged in a new PeerTube -# on url+'/oauth-clients/local' +# on url+'/api/v1/oauth-clients/local' # ex: http://domain.example/api/v1/oauth-clients/local # Warn, no quote " inside this file [peertube] @@ -8,4 +8,4 @@ client_secret = your_client_secret username = LecygneNoir password = your_secure_pwd peertube_url = https://domain.example -OAUTHLIB_INSECURE_TRANSPORT = '0' #Default use https \ No newline at end of file +OAUTHLIB_INSECURE_TRANSPORT = '0' #Default use https From 34103c49f2c9943b091b2364ec9d7c88b2fb3576 Mon Sep 17 00:00:00 2001 From: Zykino Date: Sun, 9 Sep 2018 21:19:34 +0200 Subject: [PATCH 3/4] print the peertube response.json when in error --- lib/pt_upload.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pt_upload.py b/lib/pt_upload.py index fa3225d..a5961a2 100644 --- a/lib/pt_upload.py +++ b/lib/pt_upload.py @@ -138,6 +138,7 @@ def upload_video(oauth, secret, options): else: logging.error(('Peertube: The upload failed with an unexpected response: ' '%s') % response) + print(response.json()) exit(1) From 3b76221f29e24c2bd759e6b3e1ae9a7295a64053 Mon Sep 17 00:00:00 2001 From: Zykino Date: Tue, 11 Sep 2018 22:08:30 +0200 Subject: [PATCH 4/4] update shebang to use python2 instead of the distrb prefered --- lib/pt_upload.py | 2 +- lib/yt_upload.py | 2 +- prismedia_upload.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pt_upload.py b/lib/pt_upload.py index a5961a2..a765de9 100644 --- a/lib/pt_upload.py +++ b/lib/pt_upload.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 # coding: utf-8 import os diff --git a/lib/yt_upload.py b/lib/yt_upload.py index df58e04..b28d495 100644 --- a/lib/yt_upload.py +++ b/lib/yt_upload.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 # coding: utf-8 # From Youtube samples : https://raw.githubusercontent.com/youtube/api-samples/master/python/upload_video.py # noqa diff --git a/prismedia_upload.py b/prismedia_upload.py index 27d8b8d..4634440 100755 --- a/prismedia_upload.py +++ b/prismedia_upload.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 # coding: utf-8 """