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) diff --git a/lib/pt_upload.py b/lib/pt_upload.py index fa3225d..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 @@ -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) 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/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 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 """