Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/giacy86/plex-preroll-trailers
Simple and rough set of python script that download trailers for the upcoming/now playing movies in theathers and show it as a preroll video before watch movies in Plex.
https://github.com/giacy86/plex-preroll-trailers
Last synced: 5 days ago
JSON representation
Simple and rough set of python script that download trailers for the upcoming/now playing movies in theathers and show it as a preroll video before watch movies in Plex.
- Host: GitHub
- URL: https://github.com/giacy86/plex-preroll-trailers
- Owner: giacy86
- License: gpl-3.0
- Created: 2018-04-24T19:07:49.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-15T06:20:47.000Z (over 4 years ago)
- Last Synced: 2024-08-01T21:54:10.896Z (3 months ago)
- Language: Python
- Size: 24.4 KB
- Stars: 7
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Plex-Preroll-Trailers
Simple and rough set of python script that download trailers for the upcoming/now playing movies in theaters
and show it as a preroll video before watch movies in Plex.## Why
For having a theaters-like experience when watching movies in Plex at home.## Requirements
The heart of the scripts is written in python, so they can work on all platform that have python installed. However there are 2 bash script for Linux/Ubuntu, but they are so simple that can be adapted for other OS.- Python 2.x
- [tmdbsimple](https://github.com/celiao/tmdbsimple/blob/master/README.rst)
```
pip install tmdbsimple
```
- TheMovieDB API key
- [youtube-dl](https://github.com/rg3/youtube-dl/blob/master/README.md#installation)
```
sudo -H pip install --upgrade youtube-dl
```
- FFmpeg
## How it works
The script ***download_preroll_trailers.py*** connect to TheMovieDB.org, select a user defined numbers of movies that, for your country, **are in theaters or are upcoming**, orders them by popularity and **download from YouTube** the **trailers** associated (retrieved from TheMovieDB API), write a JSON file with the filenames of the downloaded trailers.The script ***mix_preroll_trailers.py*** load from the JSON file the filenames of the downloaded trailers, select randomly a user defined number of trailers to play within Plex and create a text file with the selected number of videos.
The script ***concat_preroll_trailers.sh*** takes the chosen videos from the text file and merge them with FFmpeg.
The script ***download_preroll_trailers.sh*** simply remove the old downloaded videos and execute the *download_preroll_trailers.py*.
## Settings
Edit the *config.ini* file, see comments in file.## Usage
- *Clone* and *cd* to the repository directory
- `sudo chmod +x *.sh`
- ``` crontab -e ``` for add the bash scripts to *CRON*. Personally i use:`0 3 * * fri path/to/download_preroll_trailers.sh # once a week download trailers`
`30 3 * * * /path/to/concat_preroll_trailers.sh # once a day mix the trailers that will be played into Plex.`
- Go to *Plex Settings > Server > Extras* click on the *Show Advanced* and into *"Cinema Trailers pre-roll video"* set */path/to/plex-preroll-trailers/preroll_trailers.mp4*
- Enable in the Plex clients the option to show trailer.