XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Update cdp.py

a4fa0ca5
H Lohaus <hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +6 -7
Modified g4f/requests/cdp.py +6 -7
@@ -1000,6 +1000,7 @@ const fieldSelectors = [
1000 1000 ];
1001 1001 // 7. Handle special cases for specific sites (like DeepSeek, Gemini, etc.)
1002 1002 (function() {
1003 if (!searchQuery) return;
1003 1004 const editor = document.querySelector(fieldSelectors.join(', '));
1004 1005 if (!editor) return;
1005 1006
@@ -1024,8 +1025,6 @@ const fieldSelectors = [
1024 1025 editor.dispatchEvent(new Event('keyup', { bubbles: true }));
1025 1026 editor.dispatchEvent(new Event('input', { bubbles: true }));
1026 1027 editor.dispatchEvent(new Event('change', { bubbles: true }));
1027
1028 enableGoogleAiMode();
1029 1028 })();
1030 1029
1031 1030
@@ -1069,12 +1068,12 @@ if (deepseekSendButton) {
1069 1068 )?.textContent.trim();
1070 1069 """
1071 1070 try:
1072 rect = await self.evaluate_js(js_code)
1073 if rect and isinstance(rect, str):
1074 debug.log(f"Clicked button with text: {rect}")
1071 text = await self.evaluate_js(js_code)
1072 if text and isinstance(text, str):
1073 debug.log(f"Clicked button with text: {text}")
1075 1074 return True
1076 1075 except Exception as e:
1077 debug.log(f"Failed to click accept button: {e}")
1076 debug.error(f"Failed to click accept button:", e)
1078 1077 return False
1079 1078
1080 1079 async def bypass_turnstile(self):
@@ -1141,7 +1140,7 @@ if (deepseekSendButton) {
1141 1140 if url.endswith(f"_{n - i}.jpg"):
1142 1141 return result
1143 1142 except Exception as e:
1144 debug.log(f"Screenshot #{i+1} failed: {e}")
1143 debug.error("Screenshot #{i+1} failed:", e)
1145 1144 return result
1146 1145
1147 1146 # response = await self.evaluate_js("""