mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-24 13:07:53 +08:00
Remove unused cf_ipcountry header and simplify user identification logic; update default browser path for Linux systems in get_nodriver function
This commit is contained in:
@@ -436,7 +436,6 @@ class Api:
|
||||
provider: str = None,
|
||||
conversation_id: str = None,
|
||||
x_user: Annotated[str | None, Header()] = None,
|
||||
cf_ipcountry: Annotated[str | None, Header()] = None,
|
||||
x_forwarded_for: Annotated[str | None, Header()] = None
|
||||
):
|
||||
if AppConfig.demo and x_forwarded_for is not None:
|
||||
@@ -511,7 +510,7 @@ class Api:
|
||||
**{
|
||||
"conversation_id": None,
|
||||
"conversation": conversation,
|
||||
"user": f"{cf_ipcountry}:{x_user}" if cf_ipcountry else x_user,
|
||||
"user": x_user,
|
||||
}
|
||||
},
|
||||
ignored=AppConfig.ignored_providers
|
||||
|
||||
@@ -177,7 +177,10 @@ async def get_nodriver(
|
||||
# Default to Edge if Chrome is not available.
|
||||
browser_executable_path = "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"
|
||||
if not os.path.exists(browser_executable_path):
|
||||
browser_executable_path = None
|
||||
# Default to Chromium on Linux systems.
|
||||
browser_executable_path = "/data/data/com.termux/files/usr/bin/chromium-browser"
|
||||
if not os.path.exists(browser_executable_path):
|
||||
browser_executable_path = None
|
||||
debug.log(f"Browser executable path: {browser_executable_path}")
|
||||
lock_file = Path(get_cookies_dir()) / ".nodriver_is_open"
|
||||
if user_data_dir:
|
||||
|
||||
Reference in New Issue
Block a user