This commit is contained in:
Mihit 2025-03-09 07:32:57 +11:00
commit eb14fcf44e
2 changed files with 20 additions and 0 deletions

18
omada-downloader.py Normal file
View File

@ -0,0 +1,18 @@
from bs4 import BeautifulSoup
import requests
def get_latest():
web_data = requests.get("https://support.omadanetworks.com/us/product/omada-software-controller/?resourceType=download")
assert web_data.status_code in range(200, 300)
soup = BeautifulSoup(web_data.content, "html.parser")
urls = soup.find_all("a", attrs={"data-vars-event-category": "Product_Download_Download"})
urls = [i["href"] for i in urls if ".deb" in i["href"]]
urls.sort(reverse=True)
return urls[0]
def main():
with open("omada_latest.deb", "wb") as file:
file.write(requests.get(get_latest()).content)
if __name__ == '__main__':
main()

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
requests
bs4