repology-openmamba.py: provide a custom user agent as required by repology.org policy
This commit is contained in:
parent
0c2162fe62
commit
f54041d4df
@ -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())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user