Cache tokens and improve Oqee login flow

Add local token caching and validation for Oqee client, including _is_token_valid, load_cache and save_cache using .oqee_token.json to reuse valid JWTs and avoid unnecessary re-authentication. Update login() to try loading cache first, keep existing credential/IP login flows with clearer logging and improved fallback/error handling, and save tokens after successful auth. Also add required imports (json, os, time) and minor logging tweak in utils/downloader.py to include the Widevine CDM device filename in the fetch message.
This commit is contained in:
√(noham)²
2026-05-26 17:21:54 +02:00
parent c49254a6e4
commit 8f115881e2
2 changed files with 86 additions and 31 deletions

View File

@@ -51,7 +51,8 @@ def get_keys(kids: list[str], method: dict) -> list[str]:
keys.append(f"{kid}:{key}")
return keys
logger.info("Fetching DRM keys via Widevine CDM...")
cdm_name = (method["device_file"]).split("/")[-1]
logger.info(f"Fetching DRM keys via Widevine CDM {cdm_name}...")
client = method["client_class"]
device = Device.load(method["device_file"])