Skip to content

Instantly share code, notes, and snippets.

@al3xtjames
Created May 8, 2023 00:14
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 al3xtjames/878d6359b01c2982d1d5a0da2224efcf to your computer and use it in GitHub Desktop.
Save al3xtjames/878d6359b01c2982d1d5a0da2224efcf to your computer and use it in GitHub Desktop.
Dump URLs of UEFI capsule updates on LVFS
from pathlib import Path
from urllib.parse import urlparse
from urllib.request import urlopen, urlretrieve
from xml.etree import ElementTree
import gzip
with urlopen("https://cdn.fwupd.org/downloads/firmware.xml.gz") as response:
xml = gzip.decompress(response.read()).decode()
root = ElementTree.fromstring(xml)
components = root.findall("./component/custom/[value='org.uefi.capsule']/../releases/release/location")
urls = [component.text for component in components]
for url in urls:
print(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment