Skip to content

Instantly share code, notes, and snippets.

@frantisekz
Last active May 18, 2023 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frantisekz/532fe80b85e81d6f5c580ac8c36b505d to your computer and use it in GitHub Desktop.
Save frantisekz/532fe80b85e81d6f5c580ac8c36b505d to your computer and use it in GitHub Desktop.
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