Update getcrx url, useragent.

This commit is contained in:
voussoir 2024-03-31 18:57:41 -07:00
parent 722e62bb20
commit cb424f69e1

View file

@ -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: