From 37334ae389f2a5a56c92c93c20fda0d7a5d3ae09 Mon Sep 17 00:00:00 2001 From: voldemort <5692900+yell0wsuit@users.noreply.github.com> Date: Thu, 24 Jul 2025 17:57:28 +0700 Subject: [PATCH] fix: enhance response handling in RemoteCDMBase and remoteWidevineCDM classes --- src/inject.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/inject.js b/src/inject.js index a759d62..d500576 100644 --- a/src/inject.js +++ b/src/inject.js @@ -291,7 +291,7 @@ class RemoteCDMBase { xhr.setRequestHeader("Content-Type", "application/json"); xhr.send(JSON.stringify(body)); const jsonData = JSON.parse(xhr.responseText); - if (jsonData.status === 200 || jsonData.message?.includes("parsed and loaded")) { + if (xhr.status === 200 || jsonData.status === "Success" || jsonData.message?.includes("parsed and loaded")) { logWithPrefix("License response parsed successfully"); return true; } else { @@ -390,7 +390,7 @@ class remoteWidevineCDM extends RemoteCDMBase { }; xhr.send(JSON.stringify(body)); const jsonData = JSON.parse(xhr.responseText); - if (jsonData.status === 200) { + if (xhr.status === 200 || jsonData.status === "Success") { logWithPrefix("Service certificate set successfully"); } else { console.error("Failed to set service certificate:", jsonData.message);