Skip to content

Commit

Permalink
[Screenshot] add aarch64 support
Browse files Browse the repository at this point in the history
  • Loading branch information
japandotorg committed Sep 19, 2024
1 parent 9562f6c commit 86cbb30
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions screenshot/common/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ async def get_driver_download_url(self) -> str:
async with self.__session.get(self.RELEASE_TAG_URL.format(version=version)) as response:
json = await response.json()
assets = json["assets"]
name: str = "{}-{}-{}.".format("geckodriver", version, self.get_os())
name: str = "{}-{}-{}.".format(
"geckodriver",
version,
"linux-aarch64" if platform.machine() == "aarch64" else self.get_os(),
)
output_dict = [asset for asset in assets if asset["name"].startswith(name)]
url: str = output_dict[0]["browser_download_url"]
log.debug("Downloading driver (%s) for [%s]" % (url, self.get_os()))
Expand All @@ -140,7 +144,9 @@ async def download_and_extract_driver(self) -> None:
raise DriverDownloadFailed("Failed to download the driver.")
path: pathlib.Path = list(self.data_directory.glob("geckodriver*"))[0]
idx: int = path.name.rfind(".")
name: str = path.name[:idx] + "-{}".format(self.get_os())
name: str = path.name[:idx] + "-{}".format(
"linux-aarch64" if platform.machine() == "aarch64" else self.get_os()
)
os.rename(
path,
(
Expand Down

0 comments on commit 86cbb30

Please sign in to comment.