mirror of
https://github.com/calibrain/shelfmark.git
synced 2026-10-04 10:21:11 +01:00
Adding chrome logging (#134)
This commit is contained in:
+10
-1
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user