mirror of
https://github.com/Laborratte5/linux-iso-seeder.git
synced 2025-12-30 17:08:17 +01:00
Fixing kali
This commit is contained in:
parent
87e7ad5344
commit
2dcee60351
1 changed files with 31 additions and 28 deletions
|
|
@ -99,45 +99,48 @@ def fetch_debian_stable():
|
||||||
|
|
||||||
def fetch_kali_latest():
|
def fetch_kali_latest():
|
||||||
url = "https://www.kali.org/get-kali/#kali-installer-images"
|
url = "https://www.kali.org/get-kali/#kali-installer-images"
|
||||||
try:
|
try:
|
||||||
r = requests.get(url, timeout=30)
|
html = requests.get(url, timeout=30).text
|
||||||
r.raise_for_status()
|
|
||||||
matches = re.findall(r"kali-linux-(\d+\.\d+)-installer-", html)
|
|
||||||
|
|
||||||
|
matches = re.findall(r"kali-linux-(\d+\.\d+)-installer-", html)
|
||||||
if not matches:
|
if not matches:
|
||||||
logging.warning("Could not detect a Kali release number on %s", url)
|
logging.warning("Could not detect a Kali release number on %s", url)
|
||||||
return None
|
return False
|
||||||
# pick the highest version (works because <major>.<minor>)
|
|
||||||
latest = max(matches, key=lambda v: tuple(map(int, v.split("."))))
|
ver = max(matches, key=lambda v: tuple(map(int, v.split(".")))) # nyeste
|
||||||
|
|
||||||
|
base_cd = f"https://cdimage.kali.org/kali-{ver}"
|
||||||
|
base_arm = f"https://kali.download/arm-images/kali-{ver}"
|
||||||
|
|
||||||
baseCD = f"https://cdimage.kali.org/kali-{ver}/kali-linux-{ver}-installer"
|
|
||||||
baseARM = f"https://kali.download/arm-images/kali-{ver}/kali-linux-{ver}"
|
|
||||||
torrents = [
|
torrents = [
|
||||||
f"{baseCD}-amd64.iso.torrent",
|
# --- ISO-installer-filer (cdimage) ---
|
||||||
f"{baseCD}-netinst-amd64.iso.torrent",
|
f"{base_cd}/kali-linux-{ver}-installer-amd64.iso.torrent",
|
||||||
f"{baseCD}-everything-amd64.iso.torrent",
|
f"{base_cd}/kali-linux-{ver}-installer-netinst-amd64.iso.torrent",
|
||||||
f"{baseCD}-arm64.iso.torrent",
|
f"{base_cd}/kali-linux-{ver}-installer-everything-amd64.iso.torrent",
|
||||||
f"{baseCD}-netinst-arm64.iso.torrent",
|
f"{base_cd}/kali-linux-{ver}-installer-arm64.iso.torrent",
|
||||||
f"{baseCD}-purple-amd64.iso.torrent",
|
f"{base_cd}/kali-linux-{ver}-installer-netinst-arm64.iso.torrent",
|
||||||
f"{baseARM}-raspberry-pi-armhf.img.xz.torrent",
|
f"{base_cd}/kali-linux-{ver}-installer-purple-amd64.iso.torrent",
|
||||||
f"{baseARM}-raspberry-pi-zero-2-w-armhf.img.xz.torrent",
|
# --- ARM-/cloud-images (arm-spejl) ---
|
||||||
f"{baseARM}-raspberry-pi-zero-w-armel.img.xz.torrent",
|
f"{base_arm}/kali-linux-{ver}-raspberry-pi-armhf.img.xz.torrent",
|
||||||
f"{baseARM}-cloud-genericcloud-amd64.tar.xz.torrent",
|
f"{base_arm}/kali-linux-{ver}-raspberry-pi-zero-2-w-armhf.img.xz.torrent",
|
||||||
f"{baseARM}-cloud-genericcloud-arm64.tar.xz.torrent",
|
f"{base_arm}/kali-linux-{ver}-raspberry-pi-zero-w-armel.img.xz.torrent",
|
||||||
|
f"{base_arm}/kali-linux-{ver}-cloud-genericcloud-amd64.tar.xz.torrent",
|
||||||
|
f"{base_arm}/kali-linux-{ver}-cloud-genericcloud-arm64.tar.xz.torrent",
|
||||||
]
|
]
|
||||||
|
|
||||||
results = {}
|
results = {}
|
||||||
|
for turl in torrents:
|
||||||
|
name = os.path.basename(turl).replace(".torrent", "")
|
||||||
|
results[name] = download_torrent(name, turl)
|
||||||
|
|
||||||
for url in torrents:
|
if not any(results.values()):
|
||||||
name = os.path.basename(url).replace(".torrent", "")
|
logging.warning("No Kali torrents could be downloaded.")
|
||||||
results[name] = download_torrent(name, url)
|
|
||||||
|
|
||||||
if not results:
|
|
||||||
logging.warning("No Kali installer torrents found.")
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return results
|
return results
|
||||||
except Exception as e:
|
|
||||||
logging.error(f"Kali fetch error: {e}")
|
except Exception as exc:
|
||||||
|
logging.error("Kali fetch error: %s", exc)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def log_seed_ratios_via_http(rpc_url="http://localhost:9091/transmission/rpc",
|
def log_seed_ratios_via_http(rpc_url="http://localhost:9091/transmission/rpc",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue