MCPcopy
hub / github.com/0xAX/linux-insides / check_live_url

Function check_live_url

scripts/get_all_links.py:24–39  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

22 from urllib.error import URLError
23
24def check_live_url(url):
25
26 result = False
27 try:
28 ret = urlopen(url, timeout=2)
29 result = (ret.code == 200)
30 except HTTPError as e:
31 print(e, file=sys.stderr)
32 except URLError as e:
33 print(e, file=sys.stderr)
34 except timeout as e:
35 print(e, file=sys.stderr)
36 except Exception as e:
37 print(e, file=sys.stderr)
38
39 return result
40
41
42def main(path):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected