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
Cleaned test data list of DukeMTMC-reID, ICCV2021

Cleaned DukeMTMC-reID Cleaned data list of DukeMTMC-reID released with our paper accepted by ICCV 2021: Learning Instance-level Spatial-Temporal Patte

14 Feb 19, 2022
DeepStochlog Package For Python

DeepStochLog Installation Installing SWI Prolog DeepStochLog requires SWI Prolog to run. Run the following commands to install: sudo apt-add-repositor

KU Leuven Machine Learning Research Group 17 Dec 23, 2022
A simple editor for captions in .SRT file extension

WaySRT A simple editor for captions in .SRT file extension The program doesn't use any external dependecies, just run: python way_srt.py {file_name.sr

Gustavo Lopes 3 Nov 16, 2022
Python scripts for performing 3D human pose estimation using the Mobile Human Pose model in ONNX.

Python scripts for performing 3D human pose estimation using the Mobile Human Pose model in ONNX.

Ibai Gorordo 99 Dec 31, 2022
Self-Supervised depth kalilia

Self-Supervised depth kalilia

24 Oct 15, 2022
[IROS2021] NYU-VPR: Long-Term Visual Place Recognition Benchmark with View Direction and Data Anonymization Influences

NYU-VPR This repository provides the experiment code for the paper Long-Term Visual Place Recognition Benchmark with View Direction and Data Anonymiza

Automation and Intelligence for Civil Engineering (AI4CE) Lab @ NYU 22 Sep 28, 2022
Black-Box-Tuning - Black-Box Tuning for Language-Model-as-a-Service

Black-Box-Tuning Source code for paper "Black-Box Tuning for Language-Model-as-a

Tianxiang Sun 149 Jan 04, 2023
An algorithm study of the 6th iOS 10 set of Boost Camp Web Mobile

알고리즘 스터디 🔥 부스트캠프 웹모바일 6기 iOS 10조의 알고리즘 스터디 입니다. 개인적인 사정 등으로 S034, S055만 참가하였습니다. 스터디 목적 상진: 코테 합격 + 부캠끝나고 아침에 일어나기 위해 필요한 사이클 기완: 꾸준하게 자리에 앉아 공부하기 +

2 Jan 11, 2022
Object Depth via Motion and Detection Dataset

ODMD Dataset ODMD is the first dataset for learning Object Depth via Motion and Detection. ODMD training data are configurable and extensible, with ea

Brent Griffin 172 Dec 21, 2022
Contrastive learning of Class-agnostic Activation Map for Weakly Supervised Object Localization and Semantic Segmentation (CVPR 2022)

CCAM (Unsupervised) Code repository for our paper "CCAM: Contrastive learning of Class-agnostic Activation Map for Weakly Supervised Object Localizati

Computer Vision Insitute, SZU 113 Dec 27, 2022
QRec: A Python Framework for quick implementation of recommender systems (TensorFlow Based)

Introduction QRec is a Python framework for recommender systems (Supported by Python 3.7.4 and Tensorflow 1.14+) in which a number of influential and

Yu 1.4k Jan 01, 2023
Code for Fully Context-Aware Image Inpainting with a Learned Semantic Pyramid

SPN: Fully Context-Aware Image Inpainting with a Learned Semantic Pyramid Code for Fully Context-Aware Image Inpainting with a Learned Semantic Pyrami

12 Jun 27, 2022
Simulation environments for the CrazyFlie quadrotor: Used for Reinforcement Learning and Sim-to-Real Transfer

Phoenix-Drone-Simulation An OpenAI Gym environment based on PyBullet for learning to control the CrazyFlie quadrotor: Can be used for Reinforcement Le

Sven Gronauer 8 Dec 07, 2022
This repository contains code released by Google Research.

This repository contains code released by Google Research.

Google Research 26.6k Dec 31, 2022
Devkit for 3D -- Some utils for 3D object detection based on Numpy and Pytorch

D3D Devkit for 3D: Some utils for 3D object detection and tracking based on Numpy and Pytorch Please consider siting my work if you find this library

Jacob Zhong 27 Jul 07, 2022
Exploration of some patients clinical variables.

Answer_ALS_clinical_data Exploration of some patients clinical variables. All the clinical / metadata data is available here: https://data.answerals.o

1 Jan 20, 2022
Use Python, OpenCV, and MediaPipe to control a keyboard with facial gestures

CheekyKeys A Face-Computer Interface CheekyKeys lets you control your keyboard using your face. View a fuller demo and more background on the project

69 Nov 09, 2022
領域を指定し、キーを入力することで画像を保存するツールです。クラス分類用のデータセット作成を想定しています。

image-capture-class-annotation 領域を指定し、キーを入力することで画像を保存するツールです。 クラス分類用のデータセット作成を想定しています。 Requirement OpenCV 3.4.2 or later Usage 実行方法は以下です。 起動後はマウスクリック4

KazuhitoTakahashi 5 May 28, 2021
Consumer Fairness in Recommender Systems: Contextualizing Definitions and Mitigations

Consumer Fairness in Recommender Systems: Contextualizing Definitions and Mitigations This is the repository for the paper Consumer Fairness in Recomm

7 Nov 30, 2022
DISTIL: Deep dIverSified inTeractIve Learning.

DISTIL: Deep dIverSified inTeractIve Learning. An active/inter-active learning library built on py-torch for reducing labeling costs.

decile-team 110 Dec 06, 2022