Fix browser-backed Komodo and SteamDB checks

This commit is contained in:
seanbetts committed 2026-05-26 09:42:15 +01:00
1 parent ba84464c5c
commit c306b67472
6 files changed
+178 -23

No files matched your search

+6 -3
View File
@@ -71,10 +71,13 @@ fetch_json() {
rm -f "$tmp"
if [ "$allow_fallback" = "1" ] && [ "${KOMODO_PLAYWRIGHT_FALLBACK:-0}" = "1" ] && command -v playwright-cli >/dev/null 2>&1; then
if [ "$allow_fallback" = "1" ] && [ "${KOMODO_PLAYWRIGHT_FALLBACK:-0}" = "1" ] && command -v node >/dev/null 2>&1; then
maybe_set_cdp_endpoint
PLAYWRIGHT_CLI_BIN="$(command -v playwright-cli)"
PLAYWRIGHT_CORE_PATH="$(CDPATH= cd -- "$(dirname "$PLAYWRIGHT_CLI_BIN")/../lib/node_modules/@playwright/cli/node_modules/playwright-core" 2>/dev/null && pwd || true)"
PLAYWRIGHT_CORE_PATH="${PLAYWRIGHT_CORE_PATH:-}"
if command -v playwright-cli >/dev/null 2>&1; then
PLAYWRIGHT_CLI_BIN="$(command -v playwright-cli)"
PLAYWRIGHT_CORE_PATH="$(CDPATH= cd -- "$(dirname "$PLAYWRIGHT_CLI_BIN")/../lib/node_modules/@playwright/cli/node_modules/playwright-core" 2>/dev/null && pwd || true)"
fi
PLAYWRIGHT_CORE_PATH="$PLAYWRIGHT_CORE_PATH" node "$SCRIPT_DIR/fetch_with_playwright.js" "$url" "$tmp"
if jq empty "$tmp" >/dev/null 2>&1; then
mv "$tmp" "$OUT_DIR/$name.json"
+1 -1
View File
@@ -48,7 +48,7 @@ maybe_set_cdp_endpoint() {
is_challenge_page() {
path="$1"
rg -qi "Checking your browser|Just a moment|Cloudflare|cf-chl|cf-browser-verification" "$path"
rg -qi "Checking your browser|Just a moment|cf-chl|cf-browser-verification|challenge-platform|cdn-cgi/challenge-platform" "$path"
}
load_local_env
+2 -2
View File
@@ -16,13 +16,13 @@ KOMODO_ENV_FILE="${KOMODO_ENV_FILE:-$REPO_DIR/.local/komodo-env.sh}"
STEAMDB_ENV_FILE="${STEAMDB_ENV_FILE:-$REPO_DIR/.local/steamdb-env.sh}"
cleanup() {
if [ "${KOMODO_KEEP_BROWSER_OPEN:-0}" = "1" ]; then
if [ "${KOMODO_KEEP_BROWSER_OPEN:-1}" = "1" ]; then
:
elif [ -f "$KOMODO_ENV_FILE" ] && [ -x "$SCRIPT_DIR/close_komodo.sh" ]; then
"$SCRIPT_DIR/close_komodo.sh" >/dev/null 2>&1 || true
fi
if [ "${STEAMDB_KEEP_BROWSER_OPEN:-0}" = "1" ]; then
if [ "${STEAMDB_KEEP_BROWSER_OPEN:-1}" = "1" ]; then
:
elif [ -f "$STEAMDB_ENV_FILE" ] && [ -x "$SCRIPT_DIR/close_steamdb.sh" ]; then
"$SCRIPT_DIR/close_steamdb.sh" >/dev/null 2>&1 || true