Fetch all available Edge browser versions for a platform from enterprise API.
(platform)
| 188 | |
| 189 | |
| 190 | def get_edge_versions(platform): |
| 191 | """Fetch all available Edge browser versions for a platform from enterprise API.""" |
| 192 | r = http.request("GET", "https://edgeupdates.microsoft.com/api/products?view=enterprise") |
| 193 | all_data = case_insensitive_json_loads(r.data) |
| 194 | |
| 195 | platform_name = "MacOS" if platform == "mac" else "Linux" |
| 196 | artifact_name = "pkg" if platform == "mac" else "deb" |
| 197 | |
| 198 | versions = [] |
| 199 | for data in all_data: |
| 200 | if data.get("product") != "Stable": |
| 201 | continue |
| 202 | for release in data["releases"]: |
| 203 | if release.get("platform") != platform_name: |
| 204 | continue |
| 205 | for artifact in release["artifacts"]: |
| 206 | if artifact["artifactname"] == artifact_name: |
| 207 | versions.append( |
| 208 | { |
| 209 | "url": artifact["location"], |
| 210 | "hash": artifact["hash"], |
| 211 | "version": release["productversion"], |
| 212 | } |
| 213 | ) |
| 214 | return versions |
| 215 | |
| 216 | |
| 217 | def get_edgedriver_version(major, platform): |
no test coverage detected