fix-subs-in-nested-folders
Some shows will have their subtitles nested in a Subs/
folder that is within the season itself. This causes some issues
with Plex as it will not find the subtitles if they are nested. An example of this nested structure is:
/Show Name
|- Season 01
|- S01E01.mp4
|- S01E02.mp4
|- S01E03.mp4
|- Subs/
|- S01E01/
|- Subtitle 1.srt
|- Subtitle 2.srt
|- S01E02/
|- Subtitle 1.srt
|- Subtitle 2.srt
|- S01E03/
|- Subtitle 1.srt
|- Subtitle 2.srt
|- Season 02
|- S02E01.mp4
|- S02E02.mp4
|- S02E03.mp4
|- Subs/
|- S02E01/
|- Subtitle 1.srt
|- Subtitle 2.srt
|- S02E02/
|- Subtitle 1.srt
|- Subtitle 2.srt
|- S02E03/
|- Subtitle 1.srt
|- Subtitle 2.srt
This short program will go through the folders and grab the subtitles files (.srt) and place them in the appropriate season folder. Plex should then be able to search for these subtitle files and load them correctly.
Building
Compile with C++20 using gcc:
g++ -std=c++20 -o fix_subs fix_subs ezOptionParser.hpp
Or using the Makefile:
make
Running
You can simply run once it's compile using the flag -f
to specify the top directory of the show.
./fix_subs -f "/home/daniel/Videos/Show Name/"
TODO
- Fix bug that causes the path to loop back around once subtitles files are moved
- Add ability to search the show using tvmaze.com and update the episode names
Description
Languages
C++
99.9%
Makefile
0.1%