[virtualbox-version] Add method (#480)

Track versions using https://download.virtualbox.org/virtualbox/.

Also rename virtualbox to virtualbox-releases.

---------

Co-authored-by: Marc Wrobel <marc.wrobel@gmail.com>
This commit is contained in:
Nemo
2025-08-02 01:33:40 +05:30
committed by GitHub
parent 328b156445
commit d63d0e0cc1
2 changed files with 18 additions and 1 deletions

View File

@@ -12,7 +12,6 @@ config = config_from_argv()
with ProductData(config.product) as product_data:
html = http.fetch_html(config.url)
for li in html.select_one("#DownloadVirtualBoxOldBuilds + ul").find_all("li"):
li_text = li.find("a").text.strip()

View File

@@ -0,0 +1,18 @@
from common import dates, http
from common.releasedata import ProductData, config_from_argv
"""Fetches versions from download.virtualbox.org."""
config = config_from_argv()
with ProductData(config.product) as product_data:
html = http.fetch_html(config.url)
for a in html.select("a"):
href = a["href"]
version_match = config.first_match(href)
if version_match:
version = config.render(version_match)
date_str = a.next_sibling.strip().split(" ")[0]
date = dates.parse_date(date_str)
product_data.declare_version(version, date)