mirror of https://gitlab.com/bashrc2/epicyon
Function to check if a domain is resolvable
parent
dc9ae0c117
commit
2d970cc377
3
utils.py
3
utils.py
|
@ -12,7 +12,6 @@ import shutil
|
||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
from urllib.request import URLError
|
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
from calendar import monthrange
|
from calendar import monthrange
|
||||||
|
|
||||||
|
@ -1078,5 +1077,5 @@ def siteIsActive(url: str) -> bool:
|
||||||
try:
|
try:
|
||||||
urlopen(url, timeout=10)
|
urlopen(url, timeout=10)
|
||||||
return True
|
return True
|
||||||
except URLError as err:
|
except BaseException:
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue