Cambio UA

This commit is contained in:
marco
2022-10-08 13:19:28 +02:00
parent c0a5629d8f
commit dc96c1705d
2 changed files with 2 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ cookies_file = os.path.join(config.get_data_path(), "cookies.dat")
# Headers by default, if nothing is specified
default_headers = dict()
default_headers["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36" % config.get_setting("chrome_ua_version")
default_headers["User-Agent"] = "Mozilla/5.0 (Linux; Android 13; SM-A205U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36" % config.get_setting("chrome_ua_version")
default_headers["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"
default_headers["Accept-Language"] = "it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3"
default_headers["Accept-Charset"] = "UTF-8"

View File

@@ -301,7 +301,7 @@ def get_ua_list():
try:
current_ver = config.get_setting("chrome_ua_version", default="").split(".")
data = httptools.downloadpage(url, alfa_s=True).data
new_ua_ver = scrapertools.find_single_match(data, "win64,stable,([^,]+),")
new_ua_ver = scrapertools.find_single_match(data, "android,stable,([^,]+),")
if not current_ver:
config.set_setting("chrome_ua_version", new_ua_ver)