adamgot / python-plexlibrary

Create and maintain dynamic Plex libraries based on recipes.
BSD 3-Clause "New" or "Revised" License
204 stars 40 forks source link

Python-PlexLibrary

Python command line utility for creating and maintaining dynamic Plex libraries and playlists based on "recipes".

E.g. Create a library or playlist consisting of all movies or tv shows in a Trakt list or on an IMDb chart that exist in your main library, and set the sort titles accordingly (sort only available for libraries).

.. _Trakt: https://trakt.tv/ .. _IMDb: https://imdb.com/

Disclaimer

This is still a work in progress, so major changes may occur in new versions.

Requirements

Getting started

  1. Clone or download this repo.

  2. Install Python and pip if you haven't already.

  3. Install the requirements:

    .. code-block:: shell

    pip install -r requirements.txt

  4. Copy config-template.yml to config.yml and edit it with your information.

  5. Check out the recipe examples under recipes/examples. Copy an example to recipes/ and edit it with the appropriate information.

Usage

In the base directory, run:

.. code-block:: shell

python3 plexlibrary -h

for details on how to use the utility.

.. code-block:: shell

python3 plexlibrary -l

lists available recipes.

To run a recipe named "movies_trending", run:

.. code-block:: shell

python3 plexlibrary movies_trending

(If you're on Windows, you might have to run as admin)

When you're happy with the results, automate the recipe in cron_ or equivalent (automated tasks in Windows https://technet.microsoft.com/en-us/library/cc748993(v=ws.11).aspx).

.. _cron: https://code.tutsplus.com/tutorials/scheduling-tasks-with-cron-jobs--net-8800

Pro tip! Edit the new library and uncheck "Include in dashboard". Othewise if you start watching something that exists in multiple libraries, all items will show up on the On Deck. This makes it so that only the item in your main library shows up.

Planned features

See issues.

Credit

Original functionality is based on https://gist.github.com/JonnyWong16/b1aa2c0f604ed92b9b3afaa6db18e5fd