OpenSubtitles login sends HTTP basic auth; the API wants a JSON body #271

Closed
opened 2026-08-31 09:57:39 +01:00 by naps62-yolo · 0 comments
Owner

Every subtitle download fails with "opensubtitles rejected the configured credentials", regardless of whether the username and password are correct.

OpenSubtitles::login posts to /api/v1/login with .basic_auth(username, Some(password)) and no request body. The API takes the credentials as JSON:

{"username": "...", "password": "..."}

Basic auth is answered 401, which check_status maps to Error::Unauthorized, which the subtitle lane reports as refused credentials. The search lane is unaffected because it authenticates with the Api-Key header alone, so searches return candidates and only the download fails.

The integration tests did not catch this: mount_login matched on method and path only, so the mock answered a token to any request shape.

Related: repeated failed logins are rate-limited harshly by OpenSubtitles, and the token is only cached in memory, so every daemon restart re-attempts.

Found while fixing #270.

Every subtitle download fails with "opensubtitles rejected the configured credentials", regardless of whether the username and password are correct. `OpenSubtitles::login` posts to `/api/v1/login` with `.basic_auth(username, Some(password))` and no request body. The API takes the credentials as JSON: ```json {"username": "...", "password": "..."} ``` Basic auth is answered 401, which `check_status` maps to `Error::Unauthorized`, which the subtitle lane reports as refused credentials. The search lane is unaffected because it authenticates with the `Api-Key` header alone, so searches return candidates and only the download fails. The integration tests did not catch this: `mount_login` matched on method and path only, so the mock answered a token to any request shape. Related: repeated failed logins are rate-limited harshly by OpenSubtitles, and the token is only cached in memory, so every daemon restart re-attempts. Found while fixing #270.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yolo/arr#271