mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-05 03:19:43 +00:00
fix check links
This commit is contained in:
@@ -30,7 +30,10 @@ VALID_RET = [
|
|||||||
302,
|
302,
|
||||||
]
|
]
|
||||||
IGNORES = [
|
IGNORES = [
|
||||||
'badgen.net',
|
'badgen.net',
|
||||||
|
]
|
||||||
|
OK_WHEN_FORBIDDEN = [
|
||||||
|
'linux.die.net'
|
||||||
]
|
]
|
||||||
IGNORE_GENERIC = []
|
IGNORE_GENERIC = []
|
||||||
USER_AGENT = (
|
USER_AGENT = (
|
||||||
@@ -103,6 +106,9 @@ def check_links(urls):
|
|||||||
# pylint: disable=W0703
|
# pylint: disable=W0703
|
||||||
except Exception:
|
except Exception:
|
||||||
ret = 404
|
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:
|
if ret not in VALID_RET:
|
||||||
msg = (
|
msg = (
|
||||||
f' {YELLOW}[WARN]{RESET} HEAD {url} returned {ret}'
|
f' {YELLOW}[WARN]{RESET} HEAD {url} returned {ret}'
|
||||||
|
|||||||
Reference in New Issue
Block a user