commit eb14fcf44ecb38875753ac85b239ffcf86431c9c Author: Mihit Date: Sun Mar 9 07:32:57 2025 +1100 init diff --git a/omada-downloader.py b/omada-downloader.py new file mode 100644 index 0000000..0b5bbe1 --- /dev/null +++ b/omada-downloader.py @@ -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() \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1f311f5 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +requests +bs4 \ No newline at end of file