From e1aa5a96f168b916957b265db0d9f4ae61d651b2 Mon Sep 17 00:00:00 2001 From: Isaac Good Date: Fri, 16 Feb 2024 17:14:20 -0800 Subject: [PATCH] Update the download URL for the chromedriver package --- undetected_chromedriver/patcher.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/undetected_chromedriver/patcher.py b/undetected_chromedriver/patcher.py index 1b5409d5..a4247913 100644 --- a/undetected_chromedriver/patcher.py +++ b/undetected_chromedriver/patcher.py @@ -94,8 +94,11 @@ def __init__( # Set the correct repository to download the Chromedriver from if self.is_old_chromedriver: self.url_repo = "https://chromedriver.storage.googleapis.com" + self.download_url = self.url_repo + "/%s/%s" + else: self.url_repo = "https://googlechromelabs.github.io/chrome-for-testing" + self.download_url = "https://storage.googleapis.com/chrome-for-testing-public/%s/%s/%s" self.version_main = version_main self.version_full = None @@ -277,11 +280,11 @@ def fetch_package(self): """ zip_name = f"chromedriver_{self.platform_name}.zip" if self.is_old_chromedriver: - download_url = "%s/%s/%s" % (self.url_repo, self.version_full.vstring, zip_name) + url_parts = (self.version_full.vstring, zip_name) else: zip_name = zip_name.replace("_", "-", 1) - download_url = "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/%s/%s/%s" - download_url %= (self.version_full.vstring, self.platform_name, zip_name) + url_parts = (self.version_full.vstring, self.platform_name, zip_name) + download_url = self.download_url % url_parts logger.debug("downloading from %s" % download_url) return urlretrieve(download_url)[0]