Remove uses of raw from CLI commands and serve

This commit is contained in:
rlaphoenix 2022-07-30 02:29:20 +01:00
parent 1cedba7e49
commit 7078759cdf
2 changed files with 3 additions and 11 deletions

View File

@ -42,11 +42,9 @@ def main(version: bool, debug: bool) -> None:
@click.option("-t", "--type", "type_", type=click.Choice(LicenseType.keys(), case_sensitive=False), @click.option("-t", "--type", "type_", type=click.Choice(LicenseType.keys(), case_sensitive=False),
default="STREAMING", default="STREAMING",
help="License Type to Request.") help="License Type to Request.")
@click.option("-r", "--raw", is_flag=True, default=False,
help="PSSH is Raw.")
@click.option("-p", "--privacy", is_flag=True, default=False, @click.option("-p", "--privacy", is_flag=True, default=False,
help="Use Privacy Mode, off by default.") help="Use Privacy Mode, off by default.")
def license_(device: Path, pssh: str, server: str, type_: str, raw: bool, privacy: bool): def license_(device: Path, pssh: str, server: str, type_: str, privacy: bool):
""" """
Make a License Request for PSSH to SERVER using DEVICE. Make a License Request for PSSH to SERVER using DEVICE.
It will return a list of all keys within the returned license. It will return a list of all keys within the returned license.
@ -71,7 +69,7 @@ def license_(device: Path, pssh: str, server: str, type_: str, raw: bool, privac
log.debug(device) log.debug(device)
# load cdm # load cdm
cdm = Cdm(device, pssh, raw) cdm = Cdm(device, pssh)
log.info(f"[+] Loaded CDM with PSSH: {pssh}") log.info(f"[+] Loaded CDM with PSSH: {pssh}")
log.debug(cdm) log.debug(cdm)
@ -143,10 +141,6 @@ def test(ctx: click.Context, device: Path, privacy: bool):
# Download feature on Netflix Apps. Otherwise, use STREAMING or AUTOMATIC. # Download feature on Netflix Apps. Otherwise, use STREAMING or AUTOMATIC.
license_type = LicenseType.STREAMING license_type = LicenseType.STREAMING
# If the PSSH is not a valid mp4 pssh box, nor a valid CENC Header (init data) then
# set this to True, otherwise leave it False.
raw = False
# this runs the `cdm license` CLI-command code with the data we set above # this runs the `cdm license` CLI-command code with the data we set above
# it will print information as it goes to the terminal # it will print information as it goes to the terminal
ctx.invoke( ctx.invoke(
@ -155,7 +149,6 @@ def test(ctx: click.Context, device: Path, privacy: bool):
pssh=pssh, pssh=pssh,
server=license_server, server=license_server,
type_=LicenseType.Name(license_type), type_=LicenseType.Name(license_type),
raw=raw,
privacy=privacy privacy=privacy
) )

View File

@ -71,7 +71,6 @@ async def challenge(request: web.Request) -> web.Response:
# load init data # load init data
init_data = body["init_data"] init_data = body["init_data"]
raw = bool(body.get("raw") or 0)
# load service certificate # load service certificate
service_certificate = body.get("service_certificate") service_certificate = body.get("service_certificate")
@ -82,7 +81,7 @@ async def challenge(request: web.Request) -> web.Response:
}, status=403) }, status=403)
# load cdm # load cdm
cdm = Cdm(device, init_data, raw) cdm = Cdm(device, init_data)
if service_certificate: if service_certificate:
cdm.set_service_certificate(service_certificate) cdm.set_service_certificate(service_certificate)
request.app["sessions"][session_id] = cdm request.app["sessions"][session_id] = cdm