fix(cdm): Clean up session data when retrieving cached keys

Remove decrypt_labs_session_id and challenge from session when cached keys exist but there are missing kids, ensuring clean state for subsequent requests.
This commit is contained in:
Andy
2025-09-06 18:52:20 +00:00
parent 16ee4175a4
commit ea8a7b00c9

View File

@@ -435,6 +435,12 @@ class DecryptLabsRemoteCDM:
if missing_kids: if missing_kids:
session["cached_keys"] = parsed_keys session["cached_keys"] = parsed_keys
request_data["get_cached_keys_if_exists"] = False request_data["get_cached_keys_if_exists"] = False
if "decrypt_labs_session_id" in session:
del session["decrypt_labs_session_id"]
if "challenge" in session:
del session["challenge"]
response = self._http_session.post(f"{self.host}/get-request", json=request_data, timeout=30) response = self._http_session.post(f"{self.host}/get-request", json=request_data, timeout=30)
if response.status_code == 200: if response.status_code == 200:
data = response.json() data = response.json()