Serve: Add privacy_mode flag for get_license_challenge

This commit is contained in:
rlaphoenix 2022-09-10 20:43:59 +01:00
parent deefb6fbe1
commit 8306e092e8
2 changed files with 6 additions and 2 deletions

View File

@ -167,7 +167,8 @@ class RemoteCdm(Cdm):
url=f"{self.host}/{self.device_name}/get_license_challenge/{type_}", url=f"{self.host}/{self.device_name}/get_license_challenge/{type_}",
json={ json={
"session_id": session_id.hex(), "session_id": session_id.hex(),
"init_data": pssh.dumps() "init_data": pssh.dumps(),
"privacy_mode": privacy_mode
} }
).json() ).json()
if r["status"] != 200: if r["status"] != 200:

View File

@ -194,6 +194,9 @@ async def get_license_challenge(request: web.Request) -> web.Response:
# get session id # get session id
session_id = bytes.fromhex(body["session_id"]) session_id = bytes.fromhex(body["session_id"])
# get privacy mode flag
privacy_mode = body.get("privacy_mode", True)
# get cdm # get cdm
cdm: Optional[Cdm] = request.app["cdms"].get((secret_key, device_name)) cdm: Optional[Cdm] = request.app["cdms"].get((secret_key, device_name))
if not cdm: if not cdm:
@ -219,7 +222,7 @@ async def get_license_challenge(request: web.Request) -> web.Response:
session_id=session_id, session_id=session_id,
pssh=init_data, pssh=init_data,
type_=license_type, type_=license_type,
privacy_mode=True privacy_mode=privacy_mode
) )
except InvalidSession: except InvalidSession:
return web.json_response({ return web.json_response({