JakeLunn / one-pace-plex-assistant

A CLI tool for making the process of importing One Pace episodes into Plex much easier.
14 stars 3 forks source link
assistant cli command-line command-line-tool importer one-pace one-piece plex

Description

This is a command-line tool for assisting with the import of One Pace episodes into Plex and setting up its metadata so that it's displayed nicely.

One Pace library screenshot

Using the setup-media command, the application will:

After this first stage, you should tell Plex to scan your media files and create the show. Remember that the generated file structure should be placed within your Plex folders under the One Piece folder.

Then using the setup-plex command, the application will:

Installing

Installer:

  1. Download oppa-setup.exe from the latest release.
  2. Run installer

Manual:

  1. Download the latest release .exe and place it somewhere, preferably into its own folder e.g. C:\tools\one-pace-plex-assistant.
  2. Add this folder to the system PATH
  3. Open command prompt, terminal or powershell and type oppa -h as a test.

Via Source Code:

  1. git clone this repo
  2. Download and install Python
  3. Open a new terminal / command prompt at the root of the repo
  4. run pip install -r requirements.txt
  5. Run main.py with python main.py <command> <your args>

How to Use

The command-line is split into 2 main functions:

setup-media

This should be the first command you run.

Arguments

--source-dir The path to the directory that contains your .mkv files downloaded via onepace.net. These files can be within sub-directories of the directory provided, too. The following folder structures will work:

/source_dir
    - /sub_dir
        - downloaded-video01.mkv
    - /sub_dir
        - downloaded-video02.mkv
OR

/source_dir
    - downloaded-video.mkv
    - downloaded-video02.mkv

--target-dir

Note: This can be a path to either a local storage directory or, if applicable, to the Plex folders themselves e.g. [..]/plex/media/anime/One Piece

This is the path to the directory where your downloaded files will be copied to, renamed, and put into folders so that it matches a format that Plex is expecting.

setup-plex

This should be done only after Plex has scanned your media files and created the show/episode in Plex. You'll notice that the show's metadata (titles, descriptions, show name) will not be correct. This command will update all the metadata to the titles & descriptions from onepace.net.

Note: You can run this command every time you add new episodes. It won't make any changes to episodes which already have correct titles and descriptions.

Arguments

--plex-token

Your plex token. This is easy to get. Instructions are here: Finding an authentication token

--plex-host

Your Plex server's host URL. If your server is hosted locally, it will likely be a localhost address. If it's hosted on the web, then just the url to your plex instance should be fine e.g. https://plex.mycoolwebsite.net

--plex-library

The name of the Plex library that contains the One Pace episodes e.g. Anime, TV

--one-piece-show-name

Optional: The name of the show in Plex. If you've changed it from One Piece to One Pace already, then you should set this as "One Pace"

--change-show-name

Optional: If this flag is included, then the show name will be changed to One Pace via metadata (the folder will remain /One Piece).

Example Usage

FAQ / Caveats

Caveats