Refactor: Code cleanup

This commit is contained in:
FoxRefire
2024-05-01 03:23:08 +09:00
parent a692290883
commit d86991455d
3 changed files with 28 additions and 42 deletions

View File

@@ -17,24 +17,22 @@ except OSError:
print("device.wvd not found! looking for device_client_id_blob and device_private_key...")
cID=await (await pyfetch("device_client_id_blob")).bytes()
pKey=await (await pyfetch("device_private_key")).bytes()
device = Device(client_id=cID,
private_key=pKey,
type_=DeviceTypes['ANDROID'],
security_level=3,
flags=None)
except OSError:
try:
print("device_client_id_blob and device_private_key not found! looking for client_id.bin and private_key.pem...")
cID=await (await pyfetch("client_id.bin")).bytes()
pKey=await (await pyfetch("private_key.pem")).bytes()
device = Device(client_id=cID,
private_key=pKey,
type_=DeviceTypes['ANDROID'],
security_level=3,
flags=None)
except OSError:
raise FileNotFoundError("CDM Keys not found!, RTFM!")
else:
device = Device(client_id=cID,
private_key=pKey,
type_=DeviceTypes['ANDROID'],
security_level=3,
flags=None)
# load cdm
cdm = Cdm.from_device(device)