Scripting your way to upload videos to peertube and youtube.
Scripting your way to upload videos to peertube and youtube. Works only with Python 2 so far.
## Dependencies
@ -38,18 +38,20 @@ You can set ``OAUTHLIB_INSECURE_TRANSPORT`` to 1 if you do not use https (not re
### Youtube
Youtube uses combination of oauth and API access to identify.
Youtube uses OAuth 2.0 to restrict its API access to identified users. Registering a client is documented [here](https://developers.google.com/youtube/v3/guides/uploading_a_video).
**Credentials**
The first time you connect, prismedia will open your browser to as you to authenticate to
Youtube and allow the app to use your Youtube channel.
**It is here you choose which channel you will upload to**.
Once authenticated, the token is stored inside the file ``.youtube_credentials.json``.
Prismedia will try to use this file at each launch, and re-ask for authentication if it does not exist.
**Credentials:** the first time you connect, prismedia will open your browser
to as you to authenticate to Youtube and allow the app to use your Youtube
channel.
**Oauth**:
The default youtube_secret.json should allow you to upload some videos.
If you plan an larger usage, please consider creating your own youtube_secret file:
**It is here you choose which channel you will upload to:** once authenticated,
the token is stored inside the file `.youtube_credentials.json`. Prismedia will
try to use this file at each launch, and re-ask for authentication if it does
not exist.
**OAuth 2.0**: the default `youtube_secret.json` should allow you to upload
some videos. If you plan a more frequent usage, please consider creating your
own `youtube_secret` file:
- Go to the [Google console](https://console.developers.google.com/).
- Create project.
@ -69,26 +71,26 @@ Supports only mp4 for cross compatibility between Youtube and Peertube.
Simply upload a video:
```
./prismedia_upload.py --file="yourvideo.mp4"
python -m prismedia.upload --file="yourvideo.mp4"
```
Specify description and tags:
```
./prismedia_upload.py --file="yourvideo.mp4" -d "My supa description" -t "tag1,tag2,foo"
python -m prismedia.upload --file="yourvideo.mp4" -d "My supa description" -t "tag1,tag2,foo"
```
Provide a thumbnail:
```
./prismedia_upload.py --file="yourvideo.mp4" -d "Video with thumbnail" --thumbnail="/path/to/your/thumbnail.jpg"
python -m prismedia.upload --file="yourvideo.mp4" -d "Video with thumbnail" --thumbnail="/path/to/your/thumbnail.jpg"