29 lines
989 B
Python
29 lines
989 B
Python
import urllib.request
|
|
import ssl
|
|
|
|
ctx = ssl.create_default_context()
|
|
ctx.check_hostname = False
|
|
ctx.verify_mode = ssl.CERT_NONE
|
|
|
|
def fetch(url):
|
|
print(f"=== Fetching {url} ===")
|
|
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)'})
|
|
try:
|
|
with urllib.request.urlopen(req, context=ctx, timeout=8) as resp:
|
|
print("Status:", resp.status)
|
|
print("Headers:", dict(resp.headers))
|
|
data = resp.read().decode('utf-8', errors='ignore')
|
|
print("Body (first 500 chars):")
|
|
print(data[:500])
|
|
except urllib.error.HTTPError as e:
|
|
print(f"HTTP Error {e.code}:", e.read().decode('utf-8', errors='ignore')[:300])
|
|
except Exception as e:
|
|
print("Error:", e)
|
|
|
|
fetch("https://sn-nas.snarfnet.net")
|
|
fetch("https://snarfnas.snarfnet.net")
|
|
fetch("https://semaphore.snarfnet.net")
|
|
fetch("https://uptime.snarfnet.net")
|
|
fetch("https://longhorn.aerodrome.snarfnet.net")
|
|
|