UA header for BIN APIs

This commit is contained in:
2026-09-29 18:23:42 -07:00
parent 1623f9d58b
commit ae219fad90

4
app.py
View File

@@ -21,7 +21,9 @@ def db():
return con
def http(url, headers=None, data=None, method="GET", timeout=12):
req = urllib.request.Request(url, headers=headers or {}, data=data, method=method)
h = {"User-Agent": "Mozilla/5.0 (Auriga toolbox)"}
h.update(headers or {})
req = urllib.request.Request(url, headers=h, data=data, method=method)
try:
with urllib.request.urlopen(req, timeout=timeout) as r:
return r.status, r.read().decode("utf-8", "replace")