diff --git a/getcrx.py b/getcrx.py index 48a0bca..7436d33 100644 --- a/getcrx.py +++ b/getcrx.py @@ -18,9 +18,11 @@ log = vlogging.getLogger(__name__, 'getcrx') FILENAME_BADCHARS = '\\/:*?<>|"' WEBSTORE_URL = 'https://chrome.google.com/webstore/detail/{extension_id}' -CRX_URL = 'https://clients2.google.com/service/update2/crx?response=redirect&prodversion=83.0.4103.116&acceptformat=crx2,crx3&x=id%3D{extension_id}%26uc' +CRX_URL = 'https://clients2.google.com/service/update2/crx?response=redirect&prodversion=121.0.6167.161&acceptformat=crx2,crx3&x=id%3D{extension_id}%26uc' +USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36' session = requests.Session() +session.headers={'User-Agent': USER_AGENT} def sanitize_filename(name): for c in FILENAME_BADCHARS: @@ -29,7 +31,7 @@ def sanitize_filename(name): def get_webstore_name_version(extension_id): url = WEBSTORE_URL.format(extension_id=extension_id) - response = session.get(url) + response = session.get(url, timeout=60) response.raise_for_status() try: