Skip to content

Commit

Permalink
gh #299 download m1 geckodriver and chromedriver binaries (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandr-kotlyar authored Feb 12, 2022
1 parent 38beae7 commit f7a0855
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Features
- Determine browsers versions on Windows 32/64 bit by many ways. MSEdge, Chrome, Chromium, Firefox. PowerShell required. ([#261](https://github.com/SergeyPirogov/webdriver_manager/issues/261), [#193](https://github.com/SergeyPirogov/webdriver_manager/issues/193), [#293](https://github.com/SergeyPirogov/webdriver_manager/issues/293)).
- Re-download webdriver binary in cases when it was not found in cache (was deleted) ([#286](https://github.com/SergeyPirogov/webdriver_manager/issues/286))
- Determine architecture of Mac M1 ARM64 for in ChromeDriverManager ([#299](https://github.com/SergeyPirogov/webdriver_manager/issues/299), [#205](https://github.com/SergeyPirogov/webdriver_manager/issues/205), [#285](https://github.com/SergeyPirogov/webdriver_manager/issues/285))
---
- ## 3.5.2
### Features
Expand Down
12 changes: 5 additions & 7 deletions webdriver_manager/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def __init__(self, name, version, os_type, url, latest_release_url,
def get_os_type(self):
if "win" in super().get_os_type():
return "win32"
return super().get_os_type()
mac = f'{super().get_os_type()}{"_m1" if "mac" in super().get_os_type() and not platform.processor() == "i386" else ""}'
return mac if 'mac' in super().get_os_type() else super().get_os_type()

def get_latest_release_version(self):
self.browser_version = get_browser_version_from_os(self.chrome_type)
Expand Down Expand Up @@ -126,18 +127,15 @@ def get_url(self):
validate_response(resp)
assets = resp.json()["assets"]

name = f"{self.get_name()}-{self.get_version()}-{self.get_os_type()}{'-aarch64' if (self.get_os_type() == 'macos' and not platform.processor() == 'i386') else ''}" + "."
name = f"{self.get_name()}-{self.get_version()}-{self.get_os_type()}."
output_dict = [
asset for asset in assets if asset['name'].startswith(name)
]
return output_dict[0]['browser_download_url']

def get_os_type(self):
return (
"macos"
if super().get_os_type().startswith("mac")
else super().get_os_type()
)
mac = f'macos{"-aarch64" if platform.processor() != "i386" else ""}'
return mac if 'mac' in super().get_os_type() else super().get_os_type()

@property
def latest_release_url(self):
Expand Down

0 comments on commit f7a0855

Please sign in to comment.