Skip to content

Instantly share code, notes, and snippets.

@Waester
Created June 2, 2024 10:45
Show Gist options
  • Save Waester/f85cf258b317211c298b236454291240 to your computer and use it in GitHub Desktop.
Save Waester/f85cf258b317211c298b236454291240 to your computer and use it in GitHub Desktop.
from bs4 import BeautifulSoup
from urllib.parse import unquote
import requests
url = 'http://dev.packages.vyos.net/'
path = '?dir=repositories/equuleus/pool/main'
def scan(_path):
page = requests.get(url + _path).text
soup = BeautifulSoup(page, 'html.parser')
for a in soup.find_all('a'):
path = None
if a['href'].endswith('.deb'):
print(unquote(a['href']))
elif _path in a['href'] and a['href'] != _path:
path = a['href']
if path:
scan(path)
scan(path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment