make_nvidia_udev.py: spoof user agent to avoid 403

This commit is contained in:
Lukas Rusak 2021-09-05 07:42:09 -07:00 committed by heitbaum
parent 8f1665c742
commit da0e0cc452
2 changed files with 12 additions and 2 deletions

View File

@ -40,7 +40,12 @@ for version in sys.argv[1:]:
for version in versions: for version in versions:
url = 'http://us.download.nvidia.com/XFree86/Linux-x86_64/' + version + '/README/supportedchips.html' url = 'http://us.download.nvidia.com/XFree86/Linux-x86_64/' + version + '/README/supportedchips.html'
page = requests.get(url)
headers = {
'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1',
}
page = requests.get(url, headers=headers)
tree = html.fromstring(page.content) tree = html.fromstring(page.content)
# These are the tables we want to use (gpu's supported by the current driver) # These are the tables we want to use (gpu's supported by the current driver)

View File

@ -20,7 +20,12 @@ for line in open(__package__, 'r'):
break break
url = 'http://us.download.nvidia.com/XFree86/Linux-x86_64/' + __version__ + '/README/supportedchips.html' url = 'http://us.download.nvidia.com/XFree86/Linux-x86_64/' + __version__ + '/README/supportedchips.html'
page = requests.get(url)
headers = {
'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1',
}
page = requests.get(url, headers=headers)
tree = html.fromstring(page.content) tree = html.fromstring(page.content)
# These are the tables we want to use (gpu's supported by the current driver) # These are the tables we want to use (gpu's supported by the current driver)