mirror of
https://github.com/seanbetts/steam-hardware-watch.git
synced 2026-10-06 05:02:52 +02:00
Fix browser-backed Komodo and SteamDB checks
This commit is contained in:
1 parent
ba84464c5c
commit
c306b67472
6 files changed
+178
-23
No files matched your search
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user