feat(api): forward exact_lang to the service context

The remote-dl client sends exact_lang in dl_params, and REST download jobs set it in the service ctx, so a service can skip the manifests of close-match languages.
This commit is contained in:
imSp4rky
2026-10-13 15:07:01 -06:00
parent 3e64a7d684
commit 4fbaf2a61a
9 changed files with 38 additions and 17 deletions
+1
View File
@@ -500,6 +500,7 @@ def perform_download(
"v_lang": params.get("v_lang", []),
"a_lang": params.get("a_lang", []),
"forced_subs": params.get("forced_subs", False),
"exact_lang": params.get("exact_lang", False),
}
# Hand-built context: record parameter sources so service dl overrides
# apply to defaults but never clobber client-sent values.
+1
View File
@@ -3277,6 +3277,7 @@ def forwarded_dl_params(data: Dict[str, Any]) -> Dict[str, Any]:
except click.BadParameter:
log.warning(f"Ignoring unknown dl_params.acodec value: {sanitize_log(name)}")
params["forced_subs"] = raw.get("forced_subs") is True
params["exact_lang"] = raw.get("exact_lang") is True
return params
+4 -1
View File
@@ -726,7 +726,7 @@ async def list_tracks(request: web.Request) -> web.Response:
dl_params:
type: object
description: |
The dl track selection (lang, v_lang, a_lang, acodec, forced_subs), in the same
The dl track selection (lang, v_lang, a_lang, acodec, forced_subs, exact_lang), in the same
form as on `/api/session/create`. The service reads it from `ctx.parent.params`.
credentials:
type: object
@@ -1831,6 +1831,9 @@ async def session_create(request: web.Request) -> web.Response:
forced_subs:
type: boolean
default: false
exact_lang:
type: boolean
default: false
server_cdm:
type: boolean
description: |
+3 -2
View File
@@ -1073,8 +1073,9 @@ class RemoteService:
}
if params.get("acodec") is not None:
dl_params["acodec"] = [c.name for c in params["acodec"]]
if "forced_subs" in params:
dl_params["forced_subs"] = bool(params["forced_subs"])
for key in ("forced_subs", "exact_lang"):
if key in params:
dl_params[key] = bool(params[key])
if dl_params:
create_data["dl_params"] = dl_params