Automatically creates genre collections for your Plex media

Overview

Plex Auto Genres

Plex Auto Genres is a simple script that will add genre collection tags to your media making it much easier to search for genre specific content

  1. Requirements
  2. Optimal Setup
  3. Getting Started
  4. Automating
  5. Docker Usage
  6. Troubleshooting
Movies example (with cover art set using --set-posters flag.)

Movie Collections

Anime example

Anime Collections

Requirements

  1. Python 3 - Instructions > Windows / Mac / Linux (Not required if using Docker)
  2. TMDB Api Key (Only required for non-anime libraries)

Optimal Setup

  1. Anime / Anime Movies are in their own library on your plex server. (Anime and Anime Movies can share the same library)
  2. Standard TV Shows are in their own library on your plex server.
  3. Standard Movies are in their own library on your plex server.
  4. Proper titles for your media, this makes it easier to find the media. (see https://support.plex.tv/articles/naming-and-organizing-your-tv-show-files/)

For this to work well your plex library should be sorted. Meaning standard and non-standard media should not be in the same Plex library. Anime is an example of non-standard media.

If your anime shows and standard tv shows are in the same library, you can still use this script just choose (standard) as the type. However, doing this could cause incorrect genres added to some or all of your anime media entries.

Here is an example of my plex library setup

Plex Library Example

Getting Started

  1. Read the Optimal Setup section above
  2. Run python3 -m pip install -r requirements.txt to install the required dependencies.
  3. Rename the .env.example file to .env
  4. Rename the config/config.json.example file to config/config.json. The default settings are probably fine.
  5. Edit the .env file and set your plex username, password, and server name. If you are generating collections for standard media (non anime) you will need to also obtain an TMDB Api Key (for movies and tv shows)
    Variable Authentication method Value
    PLEX_USERNAME Username and password Your Plex Username
    PLEX_PASSWORD Username and password Your Plex Password
    PLEX_SERVER_NAME Username and password Your Plex Server Name
    PLEX_BASE_URL Token Your Plex Server base URL
    PLEX_TOKEN Token Your Plex Token
    PLEX_COLLECTION_PREFIX (Optional) Prefix for the created Plex collections. For example, with a value of "*", a collection named "Adventure", the name would instead be "*Adventure".

    Default value : ""
    TMDB_API_KEY Your TMDB api key (not required for anime library tagging)
  6. Optional, If you want to update the poster art of your collections. See posters/README.md

You are now ready to run the script

usage: plex-auto-genres.py [-h] [--library LIBRARY] [--type {anime,standard-movie,standard-tv}] [--set-posters] [--sort] [--rate-anime]
                           [--create-rating-collections] [--query QUERY [QUERY ...]] [--dry] [--no-progress] [-f] [-y]

Adds genre tags (collections) to your Plex media.

optional arguments:
  -h, --help            show this help message and exit
  --library LIBRARY     The exact name of the Plex library to generate genre collections for.
  --type {anime,standard-movie,standard-tv}
                        The type of media contained in the library
  --set-posters         uploads posters located in posters/<type> of matching collections. Supports (.PNG)
  --sort                sort collections by adding the sort prefix character to the collection sort title
  --rate-anime          update media ratings with MyAnimeList ratings
  --create-rating-collections
                        sorts media into collections based off rating
  --query QUERY [QUERY ...]
                        Looks up genre and match info for the given media title.
  --dry                 Do not modify plex collections (debugging feature)
  --no-progress         Do not display the live updating progress bar
  -f, --force           Force proccess on all media (independently of proggress recorded in logs/).
  -y, --yes

examples: 
python plex-auto-genres.py --library "Anime Movies" --type anime
python plex-auto-genres.py --library "Anime Shows" --type anime
python plex-auto-genres.py --library Movies --type standard-movie
python plex-auto-genres.py --library "TV Shows" --type standard-tv

python plex-auto-genres.py --library Movies --type standard-movie --set-posters
python plex-auto-genres.py --library Movies --type standard-movie --sort
python plex-auto-genres.py --library Movies --type standard-movie --create-rating-collections

python plex-auto-genres.py --type anime --query chihayafuru
python plex-auto-genres.py --type standard-movie --query Thor Ragnarok

Example Usage

Automating

I have conveniently included a script to help with automating the process of running plex-auto-genres when combined with any number of cron scheduling tools such as crontab, windows task scheduler, etc.

If you have experience with Docker I reccommend using my docker image which will run on a schedule.

  1. Copy .env.example to .env and update the values
  2. Copy config.json.example to config.json and update the values
  3. Each entry in the run list will be executed when you run this script
  4. Have some cron/scheduling process execute python3 automate.py, I suggest running it manually first to test that its working.

Note: The first run of this script may take a long time (minutes to hours) depending on your library sizes.

Note: Don't be alarmed if you do not see any text output. The terminal output you normally see when running plex-auto-genres.py is redirected to the log file after each executed run in your config.

Docker Usage

  1. Install Docker
  2. Install Docker Compose
  3. Clone or Download this repository
  4. Edit docker/docker-compose.yml
    1. Update the volumes: paths to point to the config,logs,posters directories in this repo.
    2. Update the environment: variables. See Getting Started.
  5. Copy config/config.json.example to config/config.json
    1. Edit the run array examples to match your needs. When the script runs, each library entry in this array will be updated on your Plex server.
  6. Run docker-compose up -d, the script will run immediately then proceed to run on a schedule every night at 1am UTC. Logs will be located at logs/plex-auto-genres-automate.log

Another Docker option of this tool can be found here.

Troubleshooting

  1. If you are not seeing any new collections close your plex client and re-open it.
  2. Delete the generated plex-*-successful.txt and plex-*-failures.txt files if you want the script to generate collections from the beginning. You may want to do this if you delete your collections and need them re-created.
  3. Having the release year in the title of a tv show or movie can cause the lookup to fail in some instances. For example Battlestar Galactica (2003) will fail, but Battlestar Galactica will not.
Owner
Shane Israel
Shane Israel
A High-Quality Real Time Upscaler for Anime Video

Anime4K Anime4K is a set of open-source, high-quality real-time anime upscaling/denoising algorithms that can be implemented in any programming langua

15.7k Jan 06, 2023
A check for whether the dependency jobs are all green.

alls-green A check for whether the dependency jobs are all green. Why? Do you have more than one job in your GitHub Actions CI/CD workflows setup? Do

Re:actors 33 Jan 03, 2023
Official PyTorch Implementation of Mask-aware IoU and maYOLACT Detector [BMVC2021]

The official implementation of Mask-aware IoU and maYOLACT detector. Our implementation is based on mmdetection. Mask-aware IoU for Anchor Assignment

Kemal Oksuz 46 Sep 29, 2022
Neuron class provides LNU (Linear Neural Unit), QNU (Quadratic Neural Unit), RBF (Radial Basis Function), MLP (Multi Layer Perceptron), MLP-ELM (Multi Layer Perceptron - Extreme Learning Machine) neurons learned with Gradient descent or LeLevenberg–Marquardt algorithm

Neuron class provides LNU (Linear Neural Unit), QNU (Quadratic Neural Unit), RBF (Radial Basis Function), MLP (Multi Layer Perceptron), MLP-ELM (Multi Layer Perceptron - Extreme Learning Machine) neu

Filip Molcik 38 Dec 17, 2022
Code for Phase diagram of Stochastic Gradient Descent in high-dimensional two-layer neural networks

Phase diagram of Stochastic Gradient Descent in high-dimensional two-layer neural networks Under construction. Description Code for Phase diagram of S

Rodrigo Veiga 3 Nov 24, 2022
clustimage is a python package for unsupervised clustering of images.

clustimage The aim of clustimage is to detect natural groups or clusters of images. Image recognition is a computer vision task for identifying and ve

Erdogan Taskesen 52 Jan 02, 2023
Self-training with Weak Supervision (NAACL 2021)

This repo holds the code for our weak supervision framework, ASTRA, described in our NAACL 2021 paper: "Self-Training with Weak Supervision"

Microsoft 148 Nov 20, 2022
Official Pytorch implementation for 2021 ICCV paper "Learning Motion Priors for 4D Human Body Capture in 3D Scenes" and trained models / data

Learning Motion Priors for 4D Human Body Capture in 3D Scenes (LEMO) Official Pytorch implementation for 2021 ICCV (oral) paper "Learning Motion Prior

165 Dec 19, 2022
Pre-trained Deep Learning models and demos (high quality and extremely fast)

OpenVINO™ Toolkit - Open Model Zoo repository This repository includes optimized deep learning models and a set of demos to expedite development of hi

OpenVINO Toolkit 3.4k Dec 31, 2022
DALL-Eval: Probing the Reasoning Skills and Social Biases of Text-to-Image Generative Transformers

DALL-Eval: Probing the Reasoning Skills and Social Biases of Text-to-Image Generative Transformers Authors: Jaemin Cho, Abhay Zala, and Mohit Bansal (

Jaemin Cho 98 Dec 15, 2022
A PyTorch Implementation of Single Shot Scale-invariant Face Detector.

S³FD: Single Shot Scale-invariant Face Detector A PyTorch Implementation of Single Shot Scale-invariant Face Detector. Eval python wider_eval_pytorch.

carwin 235 Jan 07, 2023
Boundary-preserving Mask R-CNN (ECCV 2020)

BMaskR-CNN This code is developed on Detectron2 Boundary-preserving Mask R-CNN ECCV 2020 Tianheng Cheng, Xinggang Wang, Lichao Huang, Wenyu Liu Video

Hust Visual Learning Team 178 Nov 28, 2022
Decompose to Adapt: Cross-domain Object Detection via Feature Disentanglement

Decompose to Adapt: Cross-domain Object Detection via Feature Disentanglement In this project, we proposed a Domain Disentanglement Faster-RCNN (DDF)

19 Nov 24, 2022
This repository contains codes of ICCV2021 paper: SO-Pose: Exploiting Self-Occlusion for Direct 6D Pose Estimation

SO-Pose This repository contains codes of ICCV2021 paper: SO-Pose: Exploiting Self-Occlusion for Direct 6D Pose Estimation This paper is basically an

shangbuhuan 52 Nov 25, 2022
A pytorch reproduction of { Co-occurrence Feature Learning from Skeleton Data for Action Recognition and Detection with Hierarchical Aggregation }.

A PyTorch Reproduction of HCN Co-occurrence Feature Learning from Skeleton Data for Action Recognition and Detection with Hierarchical Aggregation. Ch

Guyue Hu 210 Dec 31, 2022
Embeddinghub is a database built for machine learning embeddings.

Embeddinghub is a database built for machine learning embeddings.

Featureform 1.2k Jan 01, 2023
Re-implememtation of MAE (Masked Autoencoders Are Scalable Vision Learners) using PyTorch.

mae-repo PyTorch re-implememtation of "masked autoencoders are scalable vision learners". In this repo, it heavily borrows codes from codebase https:/

Peng Qiao 1 Dec 14, 2021
UMT is a unified and flexible framework which can handle different input modality combinations, and output video moment retrieval and/or highlight detection results.

Unified Multi-modal Transformers This repository maintains the official implementation of the paper UMT: Unified Multi-modal Transformers for Joint Vi

Applied Research Center (ARC), Tencent PCG 84 Jan 04, 2023
Playable Video Generation

Playable Video Generation Playable Video Generation Willi Menapace, Stéphane Lathuilière, Sergey Tulyakov, Aliaksandr Siarohin, Elisa Ricci Paper: ArX

Willi Menapace 136 Dec 31, 2022
Simulating an AI playing 2048 using the Expectimax algorithm

2048-expectimax Simulating an AI playing 2048 using the Expectimax algorithm The base game engine uses code from here. The AI player is modeled as a m

Subha Ramesh 2 Jan 31, 2022