Skip to content

Instantly share code, notes, and snippets.

@elmoiv
Created August 28, 2020 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elmoiv/db0f0475eaca062e705d751d74166bd0 to your computer and use it in GitHub Desktop.
Save elmoiv/db0f0475eaca062e705d751d74166bd0 to your computer and use it in GitHub Desktop.
GTX 1650 driver updater
from urllib.request import urlopen
from urllib.parse import unquote
import os
DRIVER_URL = 'https://gfwsl.geforce.com/services_toolkit/services/com/nvidia/services/' \
'AjaxDriverService.php?func=DriverManualLookup&psid=112&pfid=897&osID=57&' \
'languageCode=1078&beta=0&isWHQL=0&dltype=-1&dch=1&upCRD=0&qnf=0&sort1=0&' \
'numberOfResults=10'
DRIVER_DATA = os.popen('nvidia-smi --query-gpu=driver_version --format=csv')
# Getting current version
cur_ver = DRIVER_DATA.read().split('\n')[-2]
print('Current Version:', cur_ver)
JSON = eval(urlopen(DRIVER_URL).read())['IDS'][0]['downloadInfo']
# Getting latest version
new_ver = JSON['Version']
if float(new_ver) > float(cur_ver):
print('\nNEW DRIVER FOUND!')
print('- VERSION:', new_ver)
print('- SIZE:', JSON['DownloadURLFileSize'])
print('- URL:', JSON['DownloadURL'])
input('-- Press Enter to download the driver!')
os.system('start ' + JSON['DownloadURL'])
else:
print('\nYou have the latest version!')
input()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment