返回提交历史
Modified
g4f/api/__init__.py
+1
-2
Modified
g4f/requests/__init__.py
+4
-1
XFEstudio/gpt4free
Remove unused cf_ipcountry header and simplify user identification logic; update default browser path for Linux systems in get_nodriver function
55e22ea0
代码差异
2 个文件
+5
-3
@@ -436,7 +436,6 @@ class Api:
436
436
provider: str = None,
437
437
conversation_id: str = None,
438
438
x_user: Annotated[str | None, Header()] = None,
439
cf_ipcountry: Annotated[str | None, Header()] = None,
440
439
x_forwarded_for: Annotated[str | None, Header()] = None
441
440
):
442
441
if AppConfig.demo and x_forwarded_for is not None:
@@ -511,7 +510,7 @@ class Api:
511
510
**{
512
511
"conversation_id": None,
513
512
"conversation": conversation,
514
"user": f"{cf_ipcountry}:{x_user}" if cf_ipcountry else x_user,
513
"user": x_user,
515
514
}
516
515
},
517
516
ignored=AppConfig.ignored_providers
@@ -177,7 +177,10 @@ async def get_nodriver(
177
177
# Default to Edge if Chrome is not available.
178
178
browser_executable_path = "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"
179
179
if not os.path.exists(browser_executable_path):
180
browser_executable_path = None
180
# Default to Chromium on Linux systems.
181
browser_executable_path = "/data/data/com.termux/files/usr/bin/chromium-browser"
182
if not os.path.exists(browser_executable_path):
183
browser_executable_path = None
181
184
debug.log(f"Browser executable path: {browser_executable_path}")
182
185
lock_file = Path(get_cookies_dir()) / ".nodriver_is_open"
183
186
if user_data_dir: