Refactor proxy handling in api_decrypt.py to use an empty string instead of None for improved consistency; update returned_keys check to compare against an empty string for better error handling.

This commit is contained in:
voldemort 2025-07-23 18:00:28 +07:00
parent 7f9f04d829
commit db7bea7951

View File

@ -314,8 +314,8 @@ def api_decrypt(
}
# Prepare proxies
proxies = None
if proxy is not None:
proxies = ""
if proxy != "":
is_url, protocol, fqdn = is_url_and_split(proxy)
if is_url:
proxies = {"http": proxy, "https": proxy}
@ -380,7 +380,7 @@ def api_decrypt(
json_data,
is_widevine=(not is_pr),
)
if returned_keys is None:
if returned_keys == "":
return {"status": "error", "message": key_err}
# Close session