mirror of
https://github.com/Laborratte5/linux-iso-seeder.git
synced 2025-12-30 17:08:17 +01:00
Fetching more kali images
This commit is contained in:
parent
498b0a7039
commit
0cfeb056a6
1 changed files with 14 additions and 8 deletions
|
|
@ -100,20 +100,26 @@ def fetch_arch_latest():
|
||||||
return download_torrent("archlinux-latest", torrent_url)
|
return download_torrent("archlinux-latest", torrent_url)
|
||||||
|
|
||||||
def fetch_kali_latest():
|
def fetch_kali_latest():
|
||||||
|
T_PATTERN = re.compile(r"kali-linux-(\d+\.\d+)-installer(?:-(netinst|everything))?-amd64\.iso\.torrent$")
|
||||||
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)
|
r = requests.get(url, timeout=30)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
soup = BeautifulSoup(r.text, "html.parser")
|
soup = BeautifulSoup(r.text, "html.parser")
|
||||||
|
|
||||||
for link in soup.find_all('a', href=True):
|
results = {}
|
||||||
href = link['href']
|
|
||||||
if href.endswith(".torrent"):
|
for a in soup.find_all("a", href=True):
|
||||||
torrent_url = href
|
href = a["href"]
|
||||||
|
if T_PATTERN.search(href):
|
||||||
name = os.path.basename(href).replace(".torrent", "")
|
name = os.path.basename(href).replace(".torrent", "")
|
||||||
return download_torrent(name, torrent_url)
|
results[name] = download_torrent(name, href)
|
||||||
logging.warning("No Kali torrent found.")
|
|
||||||
return False
|
if not results:
|
||||||
|
logging.warning("No Kali installer torrents found.")
|
||||||
|
return False # or return {} if you prefer
|
||||||
|
|
||||||
|
return results
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Kali fetch error: {e}")
|
logging.error(f"Kali fetch error: {e}")
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue