Prevent getting stuck on testing services that take too long to respond

This commit is contained in:
Kuba Orlik 2022-07-15 12:39:38 +02:00
parent 7f0fa65050
commit 5d7451ccb1
2 changed files with 3 additions and 2 deletions

View File

@ -32,7 +32,7 @@ while IFS= read -r DOMAIN; do
# these domains return a 404 anyways, no need to waste time on them: # these domains return a 404 anyways, no need to waste time on them:
if is_http_error "$DOMAIN"; then echo "skipping $DOMAIN"; continue; fi if is_http_error "$DOMAIN"; then echo "skipping $DOMAIN"; continue; fi
load_website "$DOMAIN?hl=pl" "$DOMAIN" load_website "$DOMAIN?hl=pl" "$DOMAIN"
sleep 4 # sometimes the consent popup needs a little time sleep 1 # sometimes the consent popup needs a little time
open_console open_console
grab "$DOMAIN before" grab "$DOMAIN before"
(tr '\n' ' ' < click-accept-all.js) | xclip -sel clip (tr '\n' ' ' < click-accept-all.js) | xclip -sel clip
@ -46,6 +46,7 @@ done <<< "$DOMAINS"
click 1270 217 # the "trash" icon, so requests from plamienie don't appear in the screenshots click 1270 217 # the "trash" icon, so requests from plamienie don't appear in the screenshots
load_website "$URL" "$URL" load_website "$URL" "$URL"
sleep 7 # sometimes the consent popup needs a little time
echo "{\"current_action\": \"Strona $ORIGIN_DOMAIN wczytana. Przygotowywanie do analizy...\"}" echo "{\"current_action\": \"Strona $ORIGIN_DOMAIN wczytana. Przygotowywanie do analizy...\"}"
grab load_website grab load_website
open_network_inspector open_network_inspector

View File

@ -248,7 +248,7 @@ screenshot_and_annotate(){
get_http_status(){ get_http_status(){
_url="$1" _url="$1"
curl -L -s -o /dev/null --head -w "%{http_code}" "$_url" curl --connect-timeout 3 --location --silent --output /dev/null --head --write-out "%{http_code}" "$_url"
} }
is_http_error(){ is_http_error(){