Skip to content

Commit

Permalink
Fix Edge API (#233)
Browse files Browse the repository at this point in the history
Change userAgentGenerator.py to use lowercase keys in getEdgeVersions

Fixes  #232
  • Loading branch information
cal4 authored Dec 3, 2024
2 parents c269afb + a1352d8 commit 9a21404
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/userAgentGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,27 +141,27 @@ def getEdgeVersions(self) -> tuple[str, str]:
)
data = response.json()
if stableProduct := next(
(product for product in data if product["Product"] == "Stable"),
(product for product in data if product["product"] == "Stable"),
None,
):
releases = stableProduct["Releases"]
releases = stableProduct["releases"]
androidRelease = next(
(release for release in releases if release["Platform"] == "Android"),
(release for release in releases if release["platform"] == "Android"),
None,
)
windowsRelease = next(
(
release
for release in releases
if release["Platform"] == "Windows"
and release["Architecture"] == "x64"
if release["platform"] == "Windows"
and release["architecture"] == "x64"
),
None,
)
if androidRelease and windowsRelease:
return (
windowsRelease["ProductVersion"],
androidRelease["ProductVersion"],
windowsRelease["productVersion"],
androidRelease["productVersion"],
)
raise HTTPError("Failed to get Edge versions.")

Expand Down

0 comments on commit 9a21404

Please sign in to comment.