feat(search): add ANONYMOUS_SEARCH to skip the login for a service

A service that sets the flag gets no cookie load, no authenticate() call and no cookie save on a search, on the CLI and in the REST search handler. /api/services reports it as anonymous_search.
This commit is contained in:
imSp4rky
2026-10-10 13:21:14 -06:00
parent 0cded6427f
commit 0a7c76561c
12 changed files with 121 additions and 13 deletions
+4
View File
@@ -98,6 +98,7 @@ Show the streaming services available on this server, filtered by your allowlist
],
"needs_auth": true,
"has_search": true,
"anonymous_search": false,
"has_drm": true,
"auth_methods": ["cookies"]
}
@@ -120,6 +121,7 @@ Field notes:
| `cli_params` | Array of parameter descriptors. Arguments have `{name, kind: "argument", required}`; options have `{name, kind: "option", opts, is_flag, default, help, type, multiple}` and, for choice options, a `choices` list. |
| `needs_auth` | Whether the service overrides `authenticate()`. |
| `has_search` | Whether the service supports `POST /api/search`. |
| `anonymous_search` | Whether `POST /api/search` operates with no login for this service. The server then ignores `credentials` and `cookies` on a search. |
| `has_drm` | Whether the service overrides a Widevine or PlayReady license hook. |
| `pending_update` | Set to `true` while a service repository refresh waits for this service's jobs to finish before it swaps in the new code. Absent otherwise. |
| `server_accounts` | Present when the server lends its own accounts for this service: `{regions: ["ca", "gb"], global: bool}`, the regions those accounts cover. A client sends no credentials, cookies, or cache for such a service. |
@@ -134,6 +136,8 @@ Field notes:
Find titles in a service by query string. The service must have a `search()` method (see `has_search` above).
For a service with `anonymous_search`, the server does not log in and ignores `credentials` and `cookies`. The server account check still applies.
**Request body**
| Field | Type | Required | Default | Description |
+1
View File
@@ -150,6 +150,7 @@ curl "$BASE/api/services" \
"help": "EXAMPLE service documentation...",
"needs_auth": true,
"has_search": true,
"anonymous_search": false,
"has_drm": true,
"auth_methods": ["cookies", "credentials"],
"cli_params": []