TPD-Keys/Helpers/capability_check.py
TPD94 a39e10c1db TPD-Keys 2.0 Release
Cleaned up code, added remote options for all services, improved modularity
2023-12-04 04:46:41 -05:00

28 lines
1.1 KiB
Python

# Import dependencies
import Helpers
import os
def capability_check():
# Check for .WVD and API Key, exit program if neither exist.
Device = Helpers.wvd_check.wvd_check()
if Device is None:
API_Key = Helpers.api_check.api_check()
if API_Key == "First run" or API_Key == None:
exit(f"No CDM or API key found, please place a CDM in {os.getcwd()}/WVDs or an API key in {os.getcwd()}/Config/api-key.txt")
else:
print("No local device found, remote decryption only.")
print(f'Using API Key: {API_Key}\n')
return None, API_Key
elif Device is not None:
API_Key = Helpers.api_check.api_check()
if API_Key == "First run" or API_Key == None:
print("No API key found, local decryption only.")
print(f'Using device at {Device}\n')
return Device, None
else:
print(f'Local and remote decryption available.')
print(f'Using device at {Device}')
print(f'Using API Key: {API_Key}\n')
return Device, API_Key