Skip site active check for onion and i2p

main
Bob Mottram 2021-02-02 15:45:40 +00:00
parent 076b2753e2
commit e9fbef95c0
1 changed files with 5 additions and 0 deletions

View File

@ -1757,6 +1757,11 @@ def siteIsActive(url: str) -> bool:
"""
if not url.startswith('http'):
return False
if '.onion/' in url or '.i2p/' in url or \
url.endswith('.onion') or \
url.endswith('.i2p'):
# skip this check for onion and i2p
return True
try:
req = urllib.request.Request(url)
urllib.request.urlopen(req, timeout=10) # nosec