Adding chrome logging (#134)

This commit is contained in:
CaliBrain
2025-04-15 08:43:45 -04:00
committed by GitHub
parent c2decb8c4f
commit 954262fb2f
2 changed files with 12 additions and 1 deletions
+10 -1
View File
@@ -4,6 +4,7 @@ import socket
from urllib.parse import urlparse
import threading
import env
from env import LOG_DIR, DEBUG
# --- SeleniumBase Import ---
from seleniumbase import Driver
@@ -99,8 +100,16 @@ def _bypass(sb, max_retries: int = MAX_RETRY) -> None:
def _get_chromium_args():
arguments = [
"-no-sandbox",
"--no-sandbox",
]
# Conditionally add verbose logging arguments
if DEBUG:
arguments.extend([
"--enable-logging", # Enable Chrome browser logging
"--v=1", # Set verbosity level for Chrome logs
"--log-file=" + str(LOG_DIR / "chrome_browser.log")
])
# Add proxy settings if configured
if PROXIES:
+2
View File
@@ -74,7 +74,9 @@ fi
# Get timezone from IP
TIMEZONE=$(pyrequests https://ipapi.co/timezone) ||
TIMEZONE=$(pyrequests http://ip-api.com/line?fields=timezone) ||
TIMEZONE=$(pyrequests http://worldtimeapi.org/api/ip | grep -oP '"timezone":"\K[^"]+') ||
TIMEZONE=$(pyrequests https://ip2tz.isthe.link/v2 | grep -oP '"timezone": *"\K[^"]+') ||
true
# If TIMEZONE is not set, use the default timezone