@ -23,23 +23,20 @@ Scripting your way to upload videos to peertube and youtube. Works with Python 3
### From pip
Simply install with
```bash
Simply install with
```sh
pip install prismedia
```
Upgrade with
```bash
Upgrade with
```sh
pip install --upgrade prismedia
```
### From source
Get the source:
```bash
Get the source:
```sh
git clone https://git.lecygnenoir.info/LecygneNoir/prismedia.git prismedia
```
@ -49,11 +46,10 @@ You may use pip to install requirements: `pip install -r requirements.txt` if yo
Otherwise, you can use [poetry ](https://python-poetry.org ), which create a virtualenv for the project directly
(Or use the existing virtualenv if one is activated)
```
```sh
poetry install
```
## Configuration
Generate sample files with `python -m prismedia.genconfig` .
@ -72,7 +68,7 @@ Youtube uses combination of oauth and API access to identify.
The first time you connect, prismedia will open your browser to ask 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`` .
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**:
@ -95,35 +91,42 @@ Support only mp4 for cross compatibility between Youtube and Peertube.
Here are some demonstration of main usage you would like!
Upload a video:
```
prismedia --file="yourvideo.mp4"
```sh
python -m prismedia --file="yourvideo.mp4"
```
Specify description and tags:
```
prismedia --file="yourvideo.mp4" -d "My supa description" -t "tag1,tag2,foo"
```sh
python -m prismedia --file="yourvideo.mp4" -d "My supa description" -t "tag1,tag2,foo"
```
Provide a thumbnail:
```
prismedia --file="yourvideo.mp4" -d "Video with thumbnail" --thumbnail="/path/to/your/thumbnail.jpg"
```sh
python -m prismedia --file="yourvideo.mp4" -d "Video with thumbnail" --thumbnail="/path/to/your/thumbnail.jpg"
```
Publish on Peertube only, while using a channel and a playlist, creating them if they does not exist.:
```
prismedia --file="yourvideo.mp4" --platform=peertube --channel="Cooking recipes" --playlist="Cake recipes" --channelCreate --playlistCreate
```sh
python -m prismedia --file="yourvideo.mp4" --platform=peertube --channel="Cooking recipes" --playlist="Cake recipes" --channelCreate --playlistCreate
```
Use a NFO file to specify your video options:
(See [Enhanced NFO ](#enhanced-use-of-nfo ) for more precise example)
```
prismedia --file="yourvideo.mp4" --nfo /path/to/your/nfo.txt
```sh
python -m prismedia --file="yourvideo.mp4" --nfo /path/to/your/nfo.txt
```
Use some credits to show some activity for you apikey so the platform know it is used and would not put your quota to 0 (only Youtube currently).
Take a look at all available options with `--help` !
To prevent Youtube from inactivating your apikey after 90days of inactivity it is recommended to launch this command automatically from a script around once a month. It will mwke a call to use a few credits from your daily quota.
On Linux and MacOS, you can use cron, on Windows the "Task Scheduler".
```sh
python -m prismedia --hearthbeat
```
prismedia --help
Take a look at all available options with `--help` !
```sh
python -m prismedia --help
```
## Enhanced use of NFO
@ -136,7 +139,7 @@ Basically, Prismedia will now load options in this order, using the last value f
`nfo.txt < directory_name.txt < video_name.txt < command line NFO < command line argument`
You'll find a complete set of samples in the [prismedia/samples ](prismedia/samples ) directory so let's take it as an example:
```
```sh
$ tree Recipes/
Recipes/
├── cli_nfo.txt
@ -149,9 +152,9 @@ Recipes/
└── yourvideo2.txt
```
By using
```
prismedia --file=/path/to/Recipes/yourvideo1.mp4 --nfo=/path/to/Recipes/cli_nfo.txt --cca
By using
```sh
python -m prismedia --file=/path/to/Recipes/yourvideo1.mp4 --nfo=/path/to/Recipes/cli_nfo.txt --cca
```
Prismedia will:
@ -186,7 +189,7 @@ Available strict options:
- --withPlatform Prevent the upload if at least one platform is not specified
- --withCategory Prevent the upload if no category
- --withLanguage Prevent upload if no language
- --withChannel Prevent upload if no channel
- --withChannel Prevent upload if no channel
## Features
@ -224,4 +227,4 @@ Available strict options:
Inspired by [peeror ](https://git.rigelk.eu/rigelk/peeror ) and [youtube-upload ](https://github.com/tokland/youtube-upload )
## Contributors
Thanks to: @Zykino , @meewan , @rigelk 😘
Thanks to: @Zykino , @meewan , @rigelk 😘