From f54041d4df855e6fccb13c3f0ee138ccf75c677a Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 14 Sep 2024 15:00:16 +0200 Subject: [PATCH] repology-openmamba.py: provide a custom user agent as required by repology.org policy --- repology-openmamba.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/repology-openmamba.py b/repology-openmamba.py index 9d329f1..62a1493 100755 --- a/repology-openmamba.py +++ b/repology-openmamba.py @@ -30,7 +30,12 @@ while True: requrl += from_package +"/" requrl += "?inrepo=openmamba&outdated=1" sys.stderr.write("Requesting: " + requrl + "\n") - url = urllib.request.urlopen(requrl) + req = urllib.request.Request( + requrl, + data=None, + headers={'User-Agent': 'autodist/1.5.3 (Linux; openmamba; reports@openmamba.org)'} + ) + url = urllib.request.urlopen(req) #print(requrl) data = json.loads(url.read().decode())