diff --git a/main.py b/main.py index 22e2e5f..2e9ee1d 100644 --- a/main.py +++ b/main.py @@ -319,11 +319,9 @@ def generate_gpts_payload(model, messages): # PANDORA_UPLOAD_URL = 'files.pandoranext.com' -VERSION = '0.7.6' +VERSION = '0.7.7' # VERSION = 'test' -UPDATE_INFO = '支持proxy参数' - - +# UPDATE_INFO = '增加Arkose请求头' # UPDATE_INFO = '【仅供临时测试使用】 ' # 解析响应中的信息 @@ -577,7 +575,7 @@ def upload_file(file_content, mime_type, api_key): try: width, height = get_image_dimensions(file_content) except Exception as e: - logger.error(f"图片信息获取异常, 切换为text/plain: {e}") + logger.error(f"图片信息获取异常, 自动切换图片大小: {e}") mime_type = 'text/plain' # logger.debug(f"文件内容: {file_content}") @@ -927,6 +925,9 @@ def send_text_prompt_and_get_response(messages, api_key, stream, model): if CUSTOM_ARKOSE: token = get_token() payload["arkose_token"] = token + # 在headers中添加新字段 + headers["Openai-Sentinel-Arkose-Token"] = token + logger.debug(f"headers: {headers}") logger.debug(f"payload: {payload}") response = requests.post(url, headers=headers, json=payload, stream=True) # print(response)