Skip to content

Add TsukiHime subtitle provider - #3480

Draft
rokogan wants to merge 1 commit into
morpheus65535:developmentfrom
roko-tech:agent/add-tsukihime-provider
Draft

Add TsukiHime subtitle provider#3480
rokogan wants to merge 1 commit into
morpheus65535:developmentfrom
roko-tech:agent/add-tsukihime-provider

Conversation

@rokogan

@rokogan rokogan commented Aug 2, 2026

Copy link
Copy Markdown

Summary

Add TsukiHime as an official Bazarr anime subtitle provider for both series episodes and movies.

The provider uses TsukiHime's public API to resolve anime by AniDB ID for episodes and AniList ID for movies, ranks matching completed releases, discovers supported subtitle attachments, and downloads the original SRT/ASS/SSA/SUB/VTT track from TsukiHime's XZ-compressed storage.

Implementation

  • add the credential-free tsukihime provider and register its empty configuration
  • reuse Bazarr's AniDB refiner for episode series IDs and episode numbers without requiring AniDB API credentials
  • reuse Bazarr's AniList refiner for movie IDs
  • support both TsukiHime-native /attach storage and AnimeTosho-mirrored /tosho/attach storage
  • preserve forced and hearing-impaired language flags and original subtitle formats
  • rank release/file candidates against the original media name and avoid duplicate download URLs
  • expose TsukiHime in the provider settings UI and supported-provider README list
  • add focused offline tests for episode and movie discovery, both storage paths, XZ decompression, invalid archives, and missing IDs

Validation

  • pytest -q tests/bazarr/: 151 passed on Python 3.12 / Windows
  • pytest -q tests/subliminal_patch/test_tsukihime.py: 5 passed
  • npm run check:ts: passed
  • npm run check: passed
  • npx prettier -c src/pages/Settings/Providers/list.tsx: passed
  • npm test -- --run src/pages/Settings/Providers/index.test.tsx: 12 passed
  • npm run build:ci: passed
  • provider import checked with Bazarr's Python 3.10 runtime
  • live episode search found 7 Arabic candidates and downloaded/decompressed a 24,038-byte SRT
  • live movie search found 20 English candidates and downloaded/decompressed a 120,348-byte ASS track from the AnimeTosho-mirrored path

The live checks were run on Windows. Local frontend checks used Node 22; upstream CI should provide the pinned Node 24.18 runtime and the full Python 3.10-3.14 matrix.

An adjacent local run of the existing AnimeTosho and AnimeTosho.xyz provider tests produced 9 passes and one existing isolated failure in test_list_subtitles_with_portuguese_br; this change does not touch that provider or its test.

Coordination and AI disclosure

I did not find an existing TsukiHime issue or pull request. This is intentionally a draft: Bazarr's contribution guide asks new features to be greenlit in Discord, and that coordination has not yet been confirmed. The PR should remain draft until that checkpoint is completed.

OpenAI Codex assisted with the implementation, tests, live validation, and pull-request preparation. The behavior was derived from observed TsukiHime API responses and reviewed against Bazarr's existing provider, refiner, configuration, and frontend conventions.

Integrate TsukiHime's public anime and torrent APIs for episode and movie searches. Resolve episodes through AniDB identifiers and movies through AniList identifiers, rank matching releases, map subtitle languages and flags, construct native or AnimeTosho-mirrored storage URLs, and validate and decompress XZ subtitle downloads.

Register the credential-free provider with Bazarr, enable the AniDB and AniList refiners it needs, expose it in provider settings, and list it in the supported-provider documentation. Add focused offline coverage for both storage paths, candidate filtering and matching, successful decompression, invalid archives, and missing identifiers.

Validated with 151 Bazarr backend tests, 5 focused TsukiHime tests, 12 provider-settings frontend tests, TypeScript and ESLint checks, targeted Prettier validation, a production-style frontend build, Python 3.10 import compatibility, and live episode and movie searches and downloads on Windows.
@morpheus65535

Copy link
Copy Markdown
Owner

Is this PR ready to get out of draft mode?

@morpheus65535 morpheus65535 added the PR on Standby PR waiting an action before it get merged. label Aug 8, 2026
@anderson-oki

anderson-oki commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

@rokogan pinging you back here to know what is missing from this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR on Standby PR waiting an action before it get merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants