Skip to content

Commit

Permalink
Add Apple Silicon M1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkaiser committed Jul 28, 2022
1 parent c37a78d commit ba1f1b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions chromedriver_binary/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import subprocess
import re
import platform

try:
from urllib.request import urlopen, URLError
Expand Down Expand Up @@ -45,17 +46,19 @@ def get_chromedriver_url(version):
"""
base_url = 'https://chromedriver.storage.googleapis.com/'
if sys.platform.startswith('linux') and sys.maxsize > 2 ** 32:
platform = 'linux'
_platform = 'linux'
architecture = '64'
elif sys.platform == 'darwin':
platform = 'mac'
_platform = 'mac'
architecture = '64'
if platform.machine() == 'arm64':
architecture += '_m1'
elif sys.platform.startswith('win'):
platform = 'win'
_platform = 'win'
architecture = '32'
else:
raise RuntimeError('Could not determine chromedriver download URL for this platform.')
return base_url + version + '/chromedriver_' + platform + architecture + '.zip'
return base_url + version + '/chromedriver_' + _platform + architecture + '.zip'


def find_binary_in_path(filename):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def run(self):

setup(
name="chromedriver-binary",
version="103.0.5060.134.0",
version="103.0.5060.134.1",
author="Daniel Kaiser",
author_email="[email protected]",
description="Installer for chromedriver.",
Expand Down

0 comments on commit ba1f1b9

Please sign in to comment.