Last active
May 18, 2023 10:45
-
-
Save frantisekz/532fe80b85e81d6f5c580ac8c36b505d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
arch = "x86_64" | |
verbose = False | |
# Subvariant and flavor pairs | |
variants = [{"kind": "Workstation", "flavor": None, "url": None}, | |
{"kind": "Everything", "flavor": "Everything-boot-iso", "url": None}, | |
{"kind": "Server", "flavor": "Server-dvd-iso", "url": None}, | |
{"kind": "Server", "flavor": "Server-boot-iso", "url": None}, | |
{"kind": "KDE", "flavor": None, "url": None}] | |
version = "rawhide" # or branched | |
urls = [] | |
stamp = 0 | |
try: | |
if verbose: | |
print("Fetching json") | |
releases = requests.get('https://openqa.fedoraproject.org/nightlies.json').json() | |
if verbose: | |
print("Fetched json") | |
except (ConnectionError, IndexError, requests.exceptions.JSONDecodeError): | |
print("E: Failed to fetch the image.") | |
raise | |
for variant in variants: | |
stamp = 0 | |
for release in releases: | |
if release["arch"] == arch and release["subvariant"] == variant["kind"]: | |
if variant["flavor"]: | |
if release["openqa"][0]["settings"]["FLAVOR"] != variant["flavor"]: | |
continue | |
#import ipdb; ipdb.set_trace() | |
if release["mtime"] > stamp and version in release["url"]: | |
stamp = release["mtime"] | |
variant["url"] = release["url"] | |
for variant in variants: | |
if verbose: | |
print("%s (%s): %s" % (variant["kind"], variant["flavor"], variant["url"])) | |
else: | |
print(variant["url"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment