This project helps adapts the One Pace releases to a format Plex can leverage, without the need to create an "Other videos" library just for One Piece. That way you can have One Piece along with you other animes.
You can visualize what it looks like in the images directory:
- Seasons are actually arcs, not TVDB seasons
- Episodes contains the metadata anyway
This project is not endorsed by the One Pace team, but I figured I might as well share the automation work if someone wanted to do the same.
There are a few requirements to make this work:
-
Install the Absolute-Series-Scanner (ASS) which has the job to map the files to the right episodes and seasons.
- Locate the Plex system folder
- Create the
Scanners/Series
in thePlex Media Server
directory (eg:/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Scanners/Series
) - Download the scanner (it's a python file), and place it in the directory created on step 2.
- If using Linux, make sure to change the permissions of that file so that Plex can use it. In doubts, refer to their installation instructions
-
Install the HAMA plugin whose job it is to get the metadata one the episodes.
- Follow their installation instructions, but TL;DR, download the zip file of the repo and place it in the
Plug-ins
folder inside thePlex Media Server
directory (orgit clone
the repo in that directory)
- Follow their installation instructions, but TL;DR, download the zip file of the repo and place it in the
-
Restart Plex
-
Verify the installation, open your Anime library in Plex > Edit > Advanced. In the "Scanner" dropdown, you should be able to select "Absolute Series Scanner" and in the "Agent" dropdown, you should see HamaTV.
-
For later in the turorial, you'll need Python3 installed on your computer to rename the files, but it can also be done with Docker
I highly recommend to have a look at Absolute-Series-Scanner/HAMA plugin as they can improve your Plex game to another level when used properly.
-
As usual with Plex, the folder structure and naming is very important. Here's the one we'll be using
└───media ├───anime │ ├───One Piece [tvdb4-81797] │ │ ├───Arc 01 - Romance Dawn │ │ │ ├───tvdb4.mapping │ │ │ └───One.Piece.E1.1080p.mkv │ │ ├───Arc 02 - Orange Town │ │ ├───Arc XX │ │ └───Arc 32 - Wano │ └───Other Anime ├───audiobooks │ └───An audiobook (1971) ├───movies │ └───A Movie (1970) └───tvshows
-
Please note the "[tvdb4-81797]" that is added to the "One Piece" folder name. ASS is able to leverage that to enable customs seasons. In the case of One Piece, it allows us to group the different arcs as if they were seasons instead of using the ones provided by TVDB.
-
In each arc directory, place the
tvdb4.mapping
file. (You could also not use the arcs directory and keep all you episodes in the same folder, and have thetvdb4.mapping
directly in theOne Piece [tvdb4-81797]
folder)
For Plex to be able to fetch the metadata of the episodes, we need to rename them to something that can be matched via the HAMA agent.
-
Open a shell/powershell terminal.
-
Change directory to the place where your One Pace mkv files are:
cd /path/to/my/mkv/folder
To make your life easier, you might want to move those files in the relevant arc directory before renaming. -
Copy the
rename.py
andepisodes-reference.json
andchapters-reference.json
file in that directory -
Run the script in dry-run mode to see what change would occur (you can try with Docker or Python):
- Python:
python rename.py --dry-run
- Docker:
docker run --rm -v "$PWD":/data -w="/data" python:3 python rename.py --dry-run
- Python:
-
Once you are okay with the changes you see, remove the
--dry-run
flag from the command and run it again. Your files will be renamed to the corresponding One Piece epidode, eg:[One Pace][3-5] Romance Dawn 03 [1080p][F5E73C4E].mkv
-->One.Piece.E3.1080p.mkv
[One Pace][677-678] Punk Hazard 12 [720p][CD83F1E9].mkkv
-->One.Piece.E603-E604.720p.mkv
[One Pace] Chapter 700-701 [720p][2A35B710].mkv
->One.Piece.E628-E630.720p.mkv
-
If not done in step 2.2, move the resulting mkv files in their respective arc directory (or all in the
One Piece [tvdb4-81797]
directory if you don't care about organizing your files)
If the files are already in their respective folder structure (see step 1) you can use the -r
or --recurse
flag to inform the script to search sub directories
-
Open a shell/powershell terminal.
-
Change directory to the directory that contains your folder structure (e.g.
One Piece [tvdb4-81797]
) -
(optional) Copy the
rename.py
andepisodes-reference.json
andchapters-reference.json
file in that directory -
Run the script in dry-run mode with the subdirectory flag to see what change would occur
- If you did step 3:
python rename.py -r --dry-run
- Or specify directory
python rename.py -d "/path/to/one/pace/files" -r --dry-run
- If you did step 3:
-
Once you are okay with the changes you see, remove the
--dry-run
flag from the command and run it again. Your files will be renamed to the corresponding One Piece epidode, eg:[One Pace][3-5] Romance Dawn 03 [1080p][F5E73C4E].mkv
-->One.Piece.E3.1080p.mkv
[One Pace][677-678] Punk Hazard 12 [720p][CD83F1E9].mkkv
-->One.Piece.E603-E604.720p.mkv
[One Pace] Chapter 700-701 [720p][2A35B710].mkv
->One.Piece.E628-E630.720p.mkv
- Make sure the Plex library that has One Piece in it uses ASS as the scanner and HAMA as the agent. Scan the library.
- If it's not picking it up properly, check:
- Make sure the directory structure of Step 1 is followed and that the
tvdb4.mapping
file is present in the arcs directories. - Do the Plex Dance
- Make sure the directory structure of Step 1 is followed and that the
Obviously, this project does not condone piracy, you should own the media (DVD/BD/..) you consume.
For contributions/constructive comments, feel free to open an issue on the Github page.
run the unit tests from the Tests
folder by using python Tests.py
- Craft posters for each arc and commit them to the repo. Placed properly, they could be picked up by HAMA automatically.