Allow configuring the Jimaku (jimaku.cc) subtitle source API URL #1

Open
opened 2026-10-18 21:57:34 +01:00 by keir · 1 comment
Owner

Summary

The online subtitle search currently always talks to https://jimaku.cc/api — the base URL is hard-coded as defaultJimakuBaseUrl in common/subtitle-sources/subtitle-sources.ts. JimakuClient already accepts a baseUrl option, but nothing ever passes one.

It would be great if the Jimaku API URL were configurable (e.g. a Jimaku API URL field next to the existing Jimaku API key field in the online subtitle search dialog), defaulting to https://jimaku.cc/api when empty.

Motivation

  • Self-hosted / mirrored instances. Jimaku is open source (Rapptz/jimaku), so running a personal instance or mirror is possible, but asbplayer can't point at it.
  • Caching proxies. Users who hit the API rate limit could point asbplayer at a caching reverse proxy in front of jimaku.cc instead of hammering the public API.
  • Network restrictions. On some networks jimaku.cc is blocked or DNS-poisoned; a user-controlled URL (e.g. a redirector/proxy on another domain) would work around that.

Proposed behaviour

  • New setting alongside the API key, stored in onlineSubtitleSourceConfig like the other Jimaku settings.
  • Empty value falls back to https://jimaku.cc/api.
  • Validate that the value is a well-formed http(s) URL; trim a trailing slash so https://jimaku.cc/api/ behaves the same as https://jimaku.cc/api.
  • Note for the docs: a custom host needs to serve CORS headers permitting the extension/app origins (or be reached through a proxy), since the requests are plain fetch from the extension UI and app.

Happy to submit a PR for this.

### Summary The online subtitle search currently always talks to `https://jimaku.cc/api` — the base URL is hard-coded as `defaultJimakuBaseUrl` in `common/subtitle-sources/subtitle-sources.ts`. `JimakuClient` already accepts a `baseUrl` option, but nothing ever passes one. It would be great if the Jimaku API URL were configurable (e.g. a **Jimaku API URL** field next to the existing **Jimaku API key** field in the online subtitle search dialog), defaulting to `https://jimaku.cc/api` when empty. ### Motivation - **Self-hosted / mirrored instances.** Jimaku is open source ([Rapptz/jimaku](https://github.com/Rapptz/jimaku)), so running a personal instance or mirror is possible, but asbplayer can't point at it. - **Caching proxies.** Users who hit the API rate limit could point asbplayer at a caching reverse proxy in front of jimaku.cc instead of hammering the public API. - **Network restrictions.** On some networks jimaku.cc is blocked or DNS-poisoned; a user-controlled URL (e.g. a redirector/proxy on another domain) would work around that. ### Proposed behaviour - New setting alongside the API key, stored in `onlineSubtitleSourceConfig` like the other Jimaku settings. - Empty value falls back to `https://jimaku.cc/api`. - Validate that the value is a well-formed http(s) URL; trim a trailing slash so `https://jimaku.cc/api/` behaves the same as `https://jimaku.cc/api`. - Note for the docs: a custom host needs to serve CORS headers permitting the extension/app origins (or be reached through a proxy), since the requests are plain `fetch` from the extension UI and app. Happy to submit a PR for this.
Author
Owner

Implementation PR: keir/asbplayer-fork#1

(It lives on the keir/asbplayer-fork working fork because this repo is a read-only mirror — Forgejo never allows pull requests targeting mirrors.)

Implementation PR: https://git.snez.coffee/keir/asbplayer-fork/pulls/1 (It lives on the `keir/asbplayer-fork` working fork because this repo is a read-only mirror — Forgejo never allows pull requests targeting mirrors.)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
keir/asbplayer#1
No description provided.