Skip to content
loukaniko85Public

About

The free, open-source media renaming suite. Matches, renames and organises your movies, TV shows and anime automatically.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

◆ SortIQ

The free, open-source media renaming suite
Matches, renames and organises your movies, TV shows and anime automatically.

Build Version License: MIT Python 3.11+ Platform


What it does

SortIQ matches your messy media files against online databases and renames them into clean, organised structures:

Inception.2010.BluRay.1080p.x264-GROUP.mkv
  →  Inception (2010).mkv

Breaking.Bad.S01E01E02.1080p.WEB-DL.mkv
  →  Breaking Bad/Season 01/Breaking Bad - S01E01-E02 - Pilot + Cat's in the Bag.mkv

Runs as a native desktop app (Linux AppImage · Windows portable .exe · macOS .app), a browser GUI via Docker + noVNC (perfect for NAS/servers), and exposes a full REST API.


Download

Platform Format Notes
Linux AppImage — no install needed Releases
Windows Portable ZIP — unzip, run .exe Releases
macOS DMG — Apple Silicon (arm64) native Releases
Docker noVNC browser GUI + REST API ghcr.io/loukaniko85/sortiq:latest

macOS note: the current build_macos.sh produces an arm64-only DMG (SortIQ-<version>-macOS.dmg). It runs natively on Apple Silicon (M1/M2/M3/M4). There is no Universal binary. Intel Macs cannot run the arm64 DMG — Rosetta 2 translates x86_64 apps for Apple Silicon, not the reverse. Intel users should run from source with an x86_64 Python/PyQt6 environment.


Quick start

Desktop (all platforms)

# Linux
chmod +x SortIQ-*.AppImage && ./SortIQ-*.AppImage

# Windows — unzip, double-click SortIQ.exe

# macOS — open the .dmg, drag SortIQ to Applications
# Apple Silicon: native arm64. Intel: use the source install (arm64 DMG is unsupported).

Docker (NAS / server / headless)

docker run -p 6080:6080 -p 8060:8060 \
  -e TMDB_API_KEY=your_key \
  -e SORTIQ_API_KEY=your_api_key \
  -v ~/Media:/media \
  ghcr.io/loukaniko85/sortiq

open http://localhost:6080/vnc.html   # Browser GUI
open http://localhost:8060/docs       # REST API docs

Get a free TMDB API key at: https://www.themoviedb.org/settings/api

If you omit SORTIQ_API_KEY, the Docker entrypoint generates one and prints it, together with the generated VNC/noVNC password, in the container log (docker logs sortiq). Authentication is on by default; SORTIQ_AUTH_DISABLED=1 turns it off for trusted networks only. See Authentication.

Local Python

python3 -m venv .venv
source .venv/bin/activate            # Windows: .venv\Scripts\activate
pip install -r requirements.txt

export TMDB_API_KEY=your_key         # Windows cmd: set TMDB_API_KEY=your_key
export SORTIQ_API_KEY=your_api_key   # REST API auth (or SORTIQ_AUTH_DISABLED=1 locally)
python3 main.py                      # GUI
uvicorn api.app:app --port 8060      # API only
python3 cli.py --help                # CLI

Authentication

Authentication is enabled by default and fails closed: until a key is configured, every non-public request returns 401 with instructions. Configure a key in either place:

export SORTIQ_API_KEY=your_secret_key
# or save "sortiq_api_key" in ~/.sortiq/settings.json

Then send it with either header:

# Preferred
curl -H "X-Api-Key: $SORTIQ_API_KEY" http://localhost:8060/api/v1/health

# Also accepted
curl -H "Authorization: Bearer $SORTIQ_API_KEY" http://localhost:8060/api/v1/health

Public endpoints (no key required): /, /docs, /redoc, /openapi.json, and /api/v1/health. Missing keys return 401; wrong keys return 403. The key is compared in constant time.

To deliberately turn authentication off on an isolated/trusted network, set SORTIQ_AUTH_DISABLED=1. Never expose a disabled instance to the internet.

Docker credentials. The container entrypoint prints the generated API key (or reports that a stored/environment key is in use) and the noVNC/VNC password at startup. If you did not pass SORTIQ_API_KEY, a random key is generated for you; retrieve it from the log:

docker logs sortiq

The generated API key is kept with the settings volume (/home/sortiq/.sortiq, normally bind-mounted from ~/.sortiq), so it persists across container restarts. The VNC password is generated per container start unless you pin it with -e VNC_PASSWORD=... (8-character VNC limit). Pass your own -e SORTIQ_API_KEY=... to pin a known API key instead.


Features

Core renaming

  • Match movies, TV shows and anime against TMDB, TVDB, and AniDB
  • Customisable naming schemes — see Naming tokens below
  • Built-in presets for Plex, Kodi, Jellyfin, FileBot-style, Anime
  • Dry-run mode — preview every rename without touching files
  • Copy or Move — keep originals or rename in place
  • Conflict resolution — choose Skip, Rename with suffix (1), or Overwrite per batch
  • Rename conflict detection — amber highlight when two files would produce the same output name
  • Full undo / redo with persistent history; Undo Batch reverses an entire rename run in one click
  • IMDb ID search — type tt1234567 in the manual search to match by IMDb ID directly
  • TMDB result caching — show lookups cached per session; batch-renaming 20 episodes of the same show does only 1 show query

Anime support

  • Real AniDB lookup (optional) — enable AniDB in Settings → Matching and supply the AniDB client name/version. Username/password fields are optional and reserved for full AniDB authentication support; the current HTTP lookup is unauthenticated. If AniDB is disabled, not configured, unreachable, or returns no result, SortIQ falls back to TMDB, so anime matching never hard-fails because AniDB is unavailable.
  • Anime absolute-episode parsing — files such as [Group] Show - 137 [1080p].mkv are recognised by their absolute episode number and mapped to Season 1, Episode 137 (the absolute number is kept as the episode number). When AniDB is enabled, SortIQ also enriches the episode title from AniDB where possible.

Filename parsing and naming

  • User-defined regex filename patterns — add your own patterns in Settings → Matching as name: regex, one per line. Named groups title, year, season, episode, and episode_title are supported. Custom patterns are tried before the built-in parsers. Invalid regexes and patterns without named groups are rejected when you save.
  • Naming-token validation — SortIQ validates the naming scheme before a rename and warns about unknown or malformed {token} placeholders instead of silently leaving them in the output filename.
  • Metadata language selection — choose the language used for TMDB titles and overviews in Settings → Matching, or with the CLI --language flag (ISO 639-1, e.g. en, ja, de). Subtitle language is selected separately.

Keyboard shortcuts

Shortcut Action
Ctrl+M Match files
Ctrl+R Rename files
Ctrl+Z Undo last rename
Ctrl+Y Redo
Ctrl+, Open Settings
Delete Remove selected files from list
Escape Cancel running match

Multi-episode handling

Correctly parses and names multi-episode files in all common scene formats:

Input filename Detected as
Show.S01E01E02.mkv Season 1, Episodes 1 and 2 (stacked)
Show.S01E01-E03.mkv Season 1, Episodes 1 through 3 (range with E prefix)
Show.S01E01-03.WEB-DL.mkv Season 1, Episodes 1 through 3 (short range)

Output: Show - S01E01-E02 - Pilot + Cat's in the Bag.mkv — compact range, all titles joined.

Scene name cleaning

Enable Clean Scene Names to strip release-group tags before matching:

Movie.2023.1080p.BluRay.x264-GROUP  →  Movie 2023
Show.S01E01.720p.WEB-DL.DD5.1.H264 →  Show S01E01

Strips quality tags, source flags, codecs, audio formats, streaming service codes, and group names.

Missing episode detection + Sonarr search

Click Missing Episodes to compare your matched TV collection against the full TMDB episode list:

  • Results displayed in compact range notation: E01-E03 E07 E12
  • Search Selected in Sonarr — select season rows, trigger automatic search for just those seasons
  • Search All Missing in Sonarr — trigger search for every missing episode at once
  • Sonarr sends the search through Prowlarr and configured indexers — no manual hunting
  • Sonarr URL and API key saved alongside other settings in ~/.sortiq/settings.json

Sonarr / Radarr / Prowlarr integration

Click Arr Suite in the toolbar to connect to your *arr stack:

  • Fetches the full wanted / missing list from Sonarr (TV episodes) and Radarr (movies)
  • Results grouped by show, fully sortable and filterable
  • Download Selected — select individual rows and trigger automatic search for just those items
  • Download All Missing — trigger search for everything in the wanted list at once
  • Sends EpisodeSearch and MoviesSearch commands directly to Sonarr / Radarr, which then query Prowlarr (or any other configured indexer) and grab the best release automatically
  • Export the full wanted list to CSV
  • All connection settings persisted to ~/.sortiq/settings.json

How Prowlarr fits in: SortIQ tells Sonarr / Radarr to search. Those apps use Prowlarr as their indexer aggregator. So Prowlarr does the actual searching, Sonarr / Radarr handle the download, and SortIQ is the trigger. You do not need a separate Prowlarr API key for this flow.

Artwork — TMDB and FanArt.tv

Source Types available
TMDB Poster (folder.jpg), backdrop / fanart (fanart.jpg)
FanArt.tv HD transparent logos, clearart, disc art, banners, thumbs

FanArt.tv provides artwork types unavailable on TMDB. Add your free client key in Settings → API Keys.

Subtitles

  • Searches by OpenSubtitles 64-bit file hash first for exact release match
  • Falls back to title + season / episode search when hash returns nothing
  • Saves .srt alongside the video file
  • Requires a free API key from opensubtitles.com

Metadata and sidecar files

  • Write Metadata — embed title, year, description, and poster thumbnail into MP4 / M4V; MKV tags via mkvpropedit (mkvtoolnix, graceful fallback if missing)
  • Write NFO — generate Kodi / Jellyfin / Emby .nfo XML sidecar files
  • Checksums — MD5, SHA1, SHA256 with optional .sfv sidecar

Utilities

Tool Description
Duplicate Finder Scan a folder for duplicate video files by content hash
Watch Folder Monitor a folder and auto-add new video files to the queue
Batch Jobs Async batch rename via REST API with progress, SSE streaming, webhooks, and cancel support (Docker)

REST API

Full Swagger UI at http://localhost:8060/docs when running via Docker:

# Dry-run preview
curl -X POST http://localhost:8060/api/v1/media/rename \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: $SORTIQ_API_KEY" \
  -d '{"files":["/media/Downloads/Movie.2024.mkv"],"dry_run":true}'

# Async batch job with webhook callback
curl -X POST http://localhost:8060/api/v1/jobs \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: $SORTIQ_API_KEY" \
  -d '{"files":["/media/Downloads/"],"output_dir":"/media/Movies","operation":"move","webhook_url":"http://..."}'

Full docs: API.md


Naming tokens

Token Description Example output
{n} Title Breaking Bad
{y} Year 2008
{s} Season number, zero-padded 01
{e} Episode or range E01 or E01-E03
{s00e00} Season and episode combined S01E01 or S01E01-E03
{t} Episode title or titles Pilot or Pilot + Cat's in the Bag
{vf} Resolution 1080p
{vc} Video codec x265
{af} Audio codec AAC
{ac} Audio channels 5.1
{bit} Bit depth 10

Long aliases are also accepted: {resolution}, {video_codec}, {audio_codec}, {channels}, {bit_depth}.


Testing

pip install -r requirements.txt -r requirements-dev.txt
pytest -q

CI builds use Python 3.11. PyQt6 wheels are not published for Python 3.14, so use Python 3.11 if you need the GUI. Core and API tests can run on newer interpreters without PyQt6 by installing only the non-GUI dependencies (see the note at the top of requirements-dev.txt).


Development

git clone https://github.com/loukaniko85/sortiq.git
cd sortiq

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt

export TMDB_API_KEY=your_key
export SORTIQ_API_KEY=dev_key        # required by the REST API
python3 main.py                      # desktop GUI
uvicorn api.app:app --port 8060      # REST API (auto-reload: add --reload)
python3 cli.py --help                # CLI
pytest -q                            # test suite
  • VERSION is the single source of truth. All build scripts and sortiq.spec read it — bump that one file, not the scripts.
  • main.py reads VERSION at runtime for the in-app version label.
  • Settings and runtime state live in ~/.sortiq/ (settings.json, history.json, presets.json).
  • Docker/API keys: SORTIQ_API_KEY; filesystem access is restricted to /media and the user home by default (SORTIQ_ALLOWED_ROOTS overrides this).

Competitive comparison

Feature SortIQ FileBot tinyMediaManager TV Rename
Free & open source ✅ ❌ ($20+) ⚠️ ($11/yr Pro) ✅
Linux ✅ ✅ ✅ ❌
Windows ✅ ✅ ✅ ✅
macOS ✅ ✅ ✅ ❌
TMDB ✅ ✅ ✅ ✅
TVDB ✅ ✅ ✅ ✅
AniDB ✅ ✅ ❌ ❌
FanArt.tv artwork ✅ ❌ ✅ ❌
Multi-episode parsing ✅ ✅ ⚠️ ✅
Missing episode detection ✅ ❌ ❌ ✅
Sonarr / Radarr / Prowlarr ✅ ❌ ❌ ❌
NFO sidecar files ✅ ❌ ✅ ❌
Embed metadata (MP4/MKV) ✅ ✅ ✅ ❌
Scene name cleaning ✅ ✅ ❌ ❌
Rename conflict detection ✅ ❌ ❌ ❌
REST API ✅ ❌ ❌ ❌
Headless / Docker ✅ ❌ ❌ ❌
Async batch jobs + webhooks ✅ ❌ ❌ ❌
Duplicate finder ✅ ❌ ❌ ❌
Watch folder ✅ ✅ ❌ ❌
Undo / redo ✅ ✅ ❌ ❌
CLI interface ✅ ✅ ❌ ❌

Building from source

# Linux AppImage (self-contained, ~115 MB)
./build_appimage.sh
# Produces: SortIQ-<VERSION>-x86_64.AppImage  (e.g. SortIQ-1.4-x86_64.AppImage)

# Windows portable zip (run in Git Bash or GitHub Actions)
./build_windows.sh
# Produces: SortIQ-<VERSION>-Windows.zip

# macOS arm64 DMG (Apple Silicon only; Intel Macs run from source)
./build_macos.sh
# Produces: SortIQ-<VERSION>-macOS.dmg

# Docker
docker build -t sortiq .
TMDB_API_KEY=your_key MEDIA_DIR=~/Movies ./docker-run.sh

CI builds run automatically on every push to main. All platform artifacts are attached to GitHub Releases; the Docker image is published to ghcr.io/loukaniko85/sortiq.


Shipped in this release

  • Native, optional AniDB lookup with automatic TMDB fallback
  • Anime absolute-episode parsing for long-running series
  • User-defined regex filename patterns with named capture groups
  • Naming-token validation before renames
  • Metadata language selection in the GUI and via --language
  • API key authentication (SORTIQ_API_KEY, X-Api-Key / Bearer)
  • SSE job progress streaming at GET /api/v1/jobs/{job_id}/stream
  • Single-source VERSION file used by the desktop app, build scripts, and spec

Upcoming

  • Trakt.tv watched-history sync
  • eBook support — rename EPUB/MOBI by ISBN or title
  • Hardlink support — rename without using extra disk space
  • Collection completeness dashboard
  • Lidarr integration for music libraries
  • Regex-pattern preset library
  • Full AniDB authentication support

Credits

Built by loukaniko.

Contributors: loukaniko

Powered by TheMovieDB · TheTVDB · AniDB · FanArt.tv · OpenSubtitles · FastAPI · PyQt6 · noVNC

MIT License

About

The free, open-source media renaming suite. Matches, renames and organises your movies, TV shows and anime automatically.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages