Git Product home page Git Product logo

plex-preroll-trailers's Introduction

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.

pip install tmdbsimple
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.

plex-preroll-trailers's People

Contributors

giacy86 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.