Skip to main content

CLI tools that allows to track episodes in a directory

Project description

MPV Tracker

Terminal UI and CLI tool for tracking watched episodes in local series or anime directories.

It keeps a global library index in SQLite and writes per-series playback state inside the tracked directory itself in .mpv-tracker.json.

TUI

Run mpv-tracker with no arguments to open the Textual interface.

The TUI is built around a few main screens:

  • Library: browse tracked series, open details, add/edit/remove entries, open MAL account settings, and open application settings.
  • Series Detail: inspect watched count, resume state, MAL linkage, playback preferences, and episode-level progress.
  • MAL: authenticate in the browser, inspect the current MAL account, and manage linked anime metadata.

Typical workflow:

  1. Launch the app with mpv-tracker
  2. Press a to add a series directory
  3. Press Enter on a series to open the detail view
  4. Select an episode and press p or Enter to play it with mpv
  5. Return to the detail view to inspect updated progress, MAL metadata, and score controls

Useful TUI features:

  • Per-series chapter-start preferences for fresh episodes
  • MAL browser authentication from inside the TUI
  • Linked MAL anime metadata with cached score, rank, popularity, synopsis, titles, genres, studios, and related info
  • Direct MAL score updates from the detail view
  • Browser-open actions for MAL profile and anime pages
  • Built-in help screen on h or ?

Progress is persisted through the same .mpv-tracker.json state file used by the CLI.

Showcase

Main TUI showcase

Add Series

Add a MAL-linked series

MAL Auth

MyAnimeList authentication screen

Demo

This repo includes vhs tapes you can use to generate short terminal demos:

  • demo/showcase.tape: main TUI flow using a tracked MAL-linked series
  • demo/mal-auth.tape: MAL settings/authentication screen walkthrough
  • demo/add-series.tape: add a new MAL-linked series from inside the TUI

Example commands:

vhs demo/showcase.tape
vhs demo/mal-auth.tape
vhs demo/add-series.tape

CLI Commands

add

  • Prompts for title, directory, and optional slug when not passed as arguments.
  • Stores the tracked series in a SQLite library database.

list

  • Shows every tracked series with watched episode count vs total discovered files.
  • Shows the currently resumed episode and time offset when present.

watch <slug> [episode]

  • Resolves the tracked series by slug.
  • Starts mpv on the tracked directory as a playlist and jumps to the resumed episode, next unwatched episode, or the explicitly selected episode.
  • Polls MPV over its IPC socket and updates .mpv-tracker.json roughly once per second so resume data survives abrupt closes.

Episode discovery currently scans only the top level of the tracked directory and sorts video files by filename.

Development

This project uses uv for dependency and virtualenv management. Useful commands:

  • Create/activate a virtualenv and install dependencies: uv sync
  • Run the linter: uv run ruff check
  • Run type checks: uv run mypy
  • Install local helpers: uv sync --group local
  • Run everything in one go: uv run ruff check && uv run mypy

Pre-commit

uv run prek install

Packaging

Builds are handled by hatchling through uv:

uv build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mpv_tracker-1.0.0.tar.gz (30.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mpv_tracker-1.0.0-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

Details for the file mpv_tracker-1.0.0.tar.gz.

File metadata

  • Download URL: mpv_tracker-1.0.0.tar.gz
  • Upload date:
  • Size: 30.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mpv_tracker-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3f58b650e85eab62a9bd8358e8f5a197c06b9c47961443a680d846fb1d49d834
MD5 3b0d42d3e06b44b3c1ac95e618825fdc
BLAKE2b-256 2ffa7c02296e8ac43cffaed79022437bbf98134a87f4346ee95866829f0d6fab

See more details on using hashes here.

File details

Details for the file mpv_tracker-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mpv_tracker-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Manjaro Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for mpv_tracker-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8dd620ef9cd5e7c8d73a20ffcfe1bfc16b00ca8bf61fedffe453fd9e519d79e5
MD5 1246708005a072355d0a3dcc39299f46
BLAKE2b-256 ccbea370535091710f10a61e965650ab2d8481d6ccaeab325309d8489ff6b921

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page