1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 15:39:43 +00:00

fix check links

This commit is contained in:
deadc0de6
2023-09-17 21:43:51 +02:00
committed by deadc0de
parent d513cf9c36
commit a08ddcb99c

View File

@@ -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}'