diff --git a/client/__pycache__/granthi_sync_client.cpython-314.pyc b/client/__pycache__/granthi_sync_client.cpython-314.pyc index 644b42f..a8eceaf 100644 Binary files a/client/__pycache__/granthi_sync_client.cpython-314.pyc and b/client/__pycache__/granthi_sync_client.cpython-314.pyc differ diff --git a/client/granthi_sync_client.py b/client/granthi_sync_client.py index 70b373b..f567271 100644 --- a/client/granthi_sync_client.py +++ b/client/granthi_sync_client.py @@ -64,6 +64,8 @@ def http_json(method, url, headers=None, body=None, form=None, timeout=30): """Returns (status, parsed-json-or-{'raw': text}).""" data = None hdrs = dict(headers or {}) + # Cloudflare in front of id.shre.ai 403s the default Python-urllib UA. + hdrs.setdefault("User-Agent", f"granthi-sync/{VERSION}") if form is not None: data = urllib.parse.urlencode(form).encode() hdrs.setdefault("Content-Type", "application/x-www-form-urlencoded") diff --git a/server/__pycache__/granthi_link.cpython-314.pyc b/server/__pycache__/granthi_link.cpython-314.pyc index ae8b1d1..eb10fe5 100644 Binary files a/server/__pycache__/granthi_link.cpython-314.pyc and b/server/__pycache__/granthi_link.cpython-314.pyc differ diff --git a/server/granthi_link.py b/server/granthi_link.py index fff0c34..f12a717 100644 --- a/server/granthi_link.py +++ b/server/granthi_link.py @@ -69,6 +69,8 @@ def http_json(method, url, headers=None, body=None, timeout=20): """Minimal JSON-over-HTTP helper. Returns (status, parsed_or_text).""" data = None hdrs = dict(headers or {}) + # Cloudflare in front of id.shre.ai 403s the default Python-urllib UA. + hdrs.setdefault("User-Agent", f"granthi-link/{VERSION}") if body is not None: data = json.dumps(body).encode() hdrs.setdefault("Content-Type", "application/json")