summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/openai/har_file.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-05-18 15:37:46 +0200
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-05-18 15:37:46 +0200
commit96e378e9e21092f486e6f77a083651865062d893 (patch)
treea8c2b770c72d1ef64b401a63af492e4322ee4c47 /g4f/Provider/openai/har_file.py
parentImprove Liabots provider, Add image api support (diff)
downloadgpt4free-96e378e9e21092f486e6f77a083651865062d893.tar
gpt4free-96e378e9e21092f486e6f77a083651865062d893.tar.gz
gpt4free-96e378e9e21092f486e6f77a083651865062d893.tar.bz2
gpt4free-96e378e9e21092f486e6f77a083651865062d893.tar.lz
gpt4free-96e378e9e21092f486e6f77a083651865062d893.tar.xz
gpt4free-96e378e9e21092f486e6f77a083651865062d893.tar.zst
gpt4free-96e378e9e21092f486e6f77a083651865062d893.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/openai/har_file.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/g4f/Provider/openai/har_file.py b/g4f/Provider/openai/har_file.py
index eefe305f..8dcbe44e 100644
--- a/g4f/Provider/openai/har_file.py
+++ b/g4f/Provider/openai/har_file.py
@@ -35,6 +35,7 @@ headers: dict = None
proofTokens: list = []
def readHAR():
+ global proofTokens
dirPath = "./"
harPath = []
chatArks = []
@@ -77,8 +78,8 @@ def readHAR():
if not accessToken:
raise NoValidHarFileError("No accessToken found in .har files")
if not chatArks:
- return None, accessToken, cookies, headers, proofTokens
- return chatArks.pop(), accessToken, cookies, headers, proofTokens
+ return None, accessToken, cookies, headers
+ return chatArks.pop(), accessToken, cookies, headers
def get_headers(entry) -> dict:
return {h['name'].lower(): h['value'] for h in entry['request']['headers'] if h['name'].lower() not in ['content-length', 'cookie'] and not h['name'].startswith(':')}
@@ -145,7 +146,7 @@ def getN() -> str:
async def getArkoseAndAccessToken(proxy: str) -> tuple[str, str, dict, dict]:
global chatArk, accessToken, cookies, headers, proofTokens
if chatArk is None or accessToken is None:
- chatArk, accessToken, cookies, headers, proofTokens = readHAR()
+ chatArk, accessToken, cookies, headers = readHAR()
if chatArk is None:
return None, accessToken, cookies, headers, proofTokens
newReq = genArkReq(chatArk)