karloskalcium / plex_linter

Linter for plex library issues

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

made-with-python License: GPL v3 Contributing



Introduction

Plex Linter is a python script that looks for various potential issues in your library, such as

  • Duplicate album titles (that could suggest albums that have been incorrectly split)
  • Duplicate artists (for artists that have been split)
  • Tracks without titles (sometimes Plex metadata deletes track titles)
  • Tracks linked to artists with Plex metadata that differ from what the MP3 tags say.

Requirements

  1. Python 3.8+.

  2. Required Python modules (see below).

Installation

Note: Steps below are for OSX (other operating systems will require tweaking to the steps).

  1. Clone the plex_linter repo.

    git clone https://github.com/karloskalcium/plex_linter
    
  2. Create and configure virtual environment. Make sure you have the correct version of python. Pyenv manages python versions.

  3. pyenv install 3.10.6 (use version in .python-version)

  4. Make sure to configure your shell's environment for pyenv following instructions in step 2 here.

  5. Once this is done, start a new shell and run pyenv version and python --version in the terminal from the root directory of the project, both should read 3.10.6

  6. Go into the Plex Linter folder.

    cd plex_linter
    
  7. Install the required python modules.

$ make python-install $ source ENV/bin/activate


1. Generate a `config.json` file.

./plex_linter.sh


1. Fill in Plex URL and credentials at the prompt to generated a Plex Access Token (optional).

Dumping default config to: ./config.json Plex Server URL: http://localhost:32400 Plex Username: your_plex_username Plex Password: your_plex_password Please edit the default configuration before running again!


1. Configure the `config.json` file.

open config.json



# Configuration

## Sample

```json
"PLEX_LIBRARIES": [
 "Music",
 "Audiobooks"
],
"PLEX_SERVER": "https://plex.your-server.com",
"PLEX_TOKEN": "<your-token>"
}

Plex

Plex Libraries

  1. Go to Plex and get all the names of your Plex Music Libraries you want to run the linter on

    • Example Library:

  2. Under PLEX_LIBRARIES, type in the Plex Library Name (exactly). Note that the linter only works for music libraries currently.

    • Format:

      "PLEX_LIBRARIES": [
        "LIBRARY_NAME_1"
        "LIBRARY_NAME_2"
      ],
      

Plex Server URL

Plex Token

  1. Obtain a Plex Access Token:

  2. Add the Plex Access Token to "PLEX_TOKEN" so that it now appears as "PLEX_TOKEN": "abcd1234",.

    • Note: Make sure it is within the quotes (") and there is a comma (,) after it.

Usage

Simply run the script/command:

./plex_linter.py

Inspiration

This project started as a fork of https://github.com/l3uddz/plex_dupefinder and used a lot of that code as a starting point.

About

Linter for plex library issues

License:MIT License


Languages

Language:Python 78.1%Language:Makefile 21.9%