Modern Apps git

← Modern-Apps.git

screenshots producer: non-urllib UA (Cloudflare 403s the default)

Commit
e75516e788c428aa0cf323c03c05ba696fd137df
Author
Vayun Mathur <[email protected]>
When
2026-11-25 19:35 UTC (10 days ago)
Parents
cead90d
The upload requests were rejected 403 by Cloudflare
because Python-urllib's default user agent is blocked;
send a producer UA.

Diff

scripts/screenshots-report.py
diff --git a/scripts/screenshots-report.py b/scripts/screenshots-report.pyindex 0f4c7dacfb..7adc0dc1ae 100755--- a/scripts/screenshots-report.py+++ b/scripts/screenshots-report.py@@ -143,6 +143,9 @@ def main():     host_header = os.environ.get("SCREENSHOTS_HOST", "")     def req(method, url, data=None, ctype=None):         r = urllib.request.Request(url, data=data, method=method)+        # Cloudflare rejects the default Python-urllib user agent (403);+        # identify as the screenshots producer instead.+        r.add_header("User-Agent", "screenshots-report/1.0")         if host_header:             r.add_header("Host", host_header)         if ctype: