From a08ddcb99c9be428a75c3afda41300a9ed2dc9ed Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Sun, 17 Sep 2023 21:43:51 +0200 Subject: [PATCH] fix check links --- scripts/check_links.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/check_links.py b/scripts/check_links.py index 85e2eed..031665b 100755 --- a/scripts/check_links.py +++ b/scripts/check_links.py @@ -30,7 +30,10 @@ VALID_RET = [ 302, ] IGNORES = [ - 'badgen.net', + 'badgen.net', +] +OK_WHEN_FORBIDDEN = [ + 'linux.die.net' ] IGNORE_GENERIC = [] USER_AGENT = ( @@ -103,6 +106,9 @@ def check_links(urls): # pylint: disable=W0703 except Exception: ret = 404 + if ret == 403 and hostname in OK_WHEN_FORBIDDEN: + print(f' [{GREEN}OK-although-{ret}{RESET}] {MAGENTA}{url}{RESET}') + continue if ret not in VALID_RET: msg = ( f' {YELLOW}[WARN]{RESET} HEAD {url} returned {ret}'