From 34afd4ea02d90ad5bf19a3305d2eb2383ecb6b4f Mon Sep 17 00:00:00 2001 From: Official-Husko Date: Sun, 30 Jun 2024 23:53:25 +0200 Subject: [PATCH] add pixeldrain api key --- modules/pixeldrain.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/pixeldrain.py b/modules/pixeldrain.py index f97a292..21895c4 100644 --- a/modules/pixeldrain.py +++ b/modules/pixeldrain.py @@ -26,7 +26,17 @@ def Uploader(file, proxy_list, user_agents, api_keys): calc_size = Site_Data_CLSS.size_unit_calc(site, file_size) - headers = {"User-Agent": ua, "Content-Type": "application/octet-stream"} + api_key = api_keys.get("apiKey", False) + + if api_key in (False, ""): + raise Exception("Missing API Credentials?") + + headers = { + "User-Agent": ua, + "Content-Type": "application/octet-stream", + "Cookie": f"pd_auth_key={api_key}" + } + proxy = random.choice(proxy_list) if proxy_list else None if calc_size == "OK":