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:
hlohaus
2025-12-23 20:52:45 +01:00
parent 509b5b8503
commit 55e22ea02b
2 changed files with 5 additions and 3 deletions

View File

@@ -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

View File

@@ -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: