Process downloaded media files from /Volumes/complete folders. Extracts RAR archives and moves files to the correct location in /Volumes/media. Handles TV series (organized by show and season) and movies.
Process media downloads from /Volumes/complete and organize them into /Volumes/media.
/Volumes/complete/Series - TV show episodes (RAR archives)/Volumes/complete/Movies - Movies (MKV files or RAR archives)/Volumes/media/Video/TV - TV shows organized as {Show Name}/Season {XX}//Volumes/media/Video/Movies - Movies as standalone filesCheck what's available to process:
ls -la /Volumes/complete/Series/
ls -la /Volumes/complete/Movies/
Skip .DS_Store and #recycle folders.
TV Series naming convention: Show.Name.SXXEXX.Quality.Source.Codec-GROUP
Examples:
Doc.2025.S02E15.720p.HDTV.x264-SYNCOPY → Show: "Doc", Year: 2025, Season: 02, Episode: 15The.Beauty.S01E06.1080p.WEB.h264-ETHEL → Show: "The Beauty", Season: 01, Episode: 06The.Traitors.2023.S04E09.1080p.WEB.h264-EDITH → Show: "The Traitors", Year: 2023, Season: 04, Episode: 09Movie naming convention: Movie.Name.Year.Quality.Source.Codec-GROUP
Examples:
Spy.Kids.2.Island.of.Lost.Dreams.2002.BluRay.1080p.DTS-HD.MA.5.1.AVC.REMUX-FraMeSToRAre.You.Being.Served.1977.1080p.BluRay.x264.FLAC.2.0-HANDJOBSearch for matching folders in the destination using flexible matching:
# For TV shows - search by show name
ls -d /Volumes/media/Video/TV/*keyword* 2>/dev/null
# For movies - search by movie name
ls -d /Volumes/media/Video/Movies/*keyword* 2>/dev/null
Season folder naming: Use Season XX format (zero-padded). If both Season 01 and Season 1 exist, prefer Season 01.
If no matching movie folder exists (this is the norm), create one using the naming convention:
<Movie Name> (<Year>)
Examples:
Spy.Kids.2.Island.of.Lost.Dreams.2002.BluRay... → Spy Kids 2 Island of Lost Dreams (2002)Are.You.Being.Served.1977.1080p.BluRay... → Are You Being Served (1977)mkdir -p "/Volumes/media/Video/Movies/Spy Kids 2 Island of Lost Dreams (2002)/"
If no matching series folder exists, create one using the naming convention:
<Series Name> (<Year>)
Examples:
Doc.2025.S02E15... → Doc (2025)The.Beauty.S01E06... → The Beauty (2025) (use current year if not in filename)The.Traitors.2023.S04E09... → The Traitors (2023)mkdir -p "/Volumes/media/Video/TV/The Beauty (2025)/Season 01/"
Note: Extract the year from the filename if present (e.g., Show.2023.S01E01). If no year is in the filename, ask the user or look it up.
For RAR archives:
unrar e -o+ "/full/path/to/source/folder/filename.rar" "/destination/path/"
The -e flag extracts without directory structure, -o+ overwrites existing files. Always use absolute paths to avoid cd commands which trigger permission prompts.
For MKV/video files (no RAR):
mv "/source/file.mkv" "/destination/path/"
For extensionless video files:
Some downloads contain video files without extensions (random string filenames). If a file has no extension but is large (>100MB), it's likely a video file. Rename it using the parent folder name with .mkv extension:
# Check for large extensionless files
find "/source/folder/" -type f -size +100M ! -name "*.*"
# Rename using folder name
mv "/source/folder/randomstring" "/destination/path/Folder.Name.S01E01.1080p.WEB.h264-GROUP.mkv"
The destination filename should be derived from the source folder name (the release name).
After successful extraction/move:
ls -la "/destination/path/" | grep -i "filename"rm -rf command to avoid multiple permission prompts:
rm -rf "/folder1" "/folder2" "/folder3" && echo "Cleanup complete"
.rar, .r00, .r01, etc.). Only run unrar on the .rar file.Folder/Folder/files.rar - navigate into the nested folder..mkv extension.mkdir -p "/path/Season XX/"/process-downloads/Volumes/complete/Series/ and /Volumes/complete/Movies/unrar is not installed, inform user to install it (brew install unrar)