Adding debian

This commit is contained in:
Kasper Plougmann 2025-07-09 22:07:10 +02:00 committed by GitHub
parent 12d5d697bd
commit ba24ef62b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -65,23 +65,36 @@ def fetch_ubuntu_lts():
return False
def fetch_debian_stable():
url = "https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/"
try:
r = requests.get(url, timeout=30)
r.raise_for_status()
soup = BeautifulSoup(r.text, "html.parser")
urls = [
"https://cdimage.debian.org/debian-cd/current/amd64/bt-dvd/",
"https://cdimage.debian.org/debian-cd/current/arm64/bt-dvd/",
"https://cdimage.debian.org/debian-cd/current/amd64/bt-cd/",
"https://cdimage.debian.org/debian-cd/current/arm64/bt-cd/"
]
results = {}
for link in soup.find_all('a', href=True):
href = link['href']
if "-DVD-1.iso.torrent" in href:
torrent_url = url + href
name = href.replace(".iso.torrent", "")
return download_torrent(name, torrent_url)
logging.warning("No Debian DVD-1 torrent found.")
return False
except Exception as e:
logging.error(f"Debian fetch error: {e}")
return False
for url in urls:
try:
r = requests.get(url, timeout=30)
r.raise_for_status()
soup = BeautifulSoup(r.text, "html.parser")
results[url] = False
for link in soup.find_all('a', href=True):
href = link['href']
if ".iso.torrent" in href:
torrent_url = url + href
name = href.replace(".iso.torrent", "")
results[name] = download_torrent(name, torrent_url)
break
else:
logging.warning("No Debian DVD-1 torrent found.")
except Exception as e:
logging.error(f"Debian fetch error: {e}")
results[url] = False
return results
def fetch_arch_latest():
torrent_url = "https://geo.mirror.pkgbuild.com/iso/latest/archlinux-x86_64.iso.torrent"
@ -170,7 +183,7 @@ if __name__ == "__main__":
success_count = 0
failure_count = 0
for func in [fetch_ubuntu_lts, fetch_debian_stable, fetch_fedora_latest, fetch_arch_latest, fetch_kali_latest, fetch_distrowatch_torrents]:
for func in [fetch_ubuntu_lts, fetch_debian_stable, fetch_kali_latest, fetch_arch_latest, fetch_distrowatch_torrents]:
if func():
success_count += 1
else: