Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed updater for blender.org changes #41

Merged
merged 1 commit into from
Jun 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 32 additions & 33 deletions BlenderUpdater.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,41 +341,40 @@ def parse_description(element):

# iterate through the found versions
results = []
for ul in soup.find("div", {"class": "page-footer-main-text"}).find_all("ul"):
for li in ul.find_all("li", class_="os"):
description_element = li.find("span", class_="name").find("small")
arch = li.find("span", class_="build").text
channel = li.find("span", class_="build-var").text
name = li.find("span", class_="name").find(text=True, recursive=False)
url = li.find("a", href=True)["href"]

description_data = parse_description(description_element)
if description_data is None:
continue

info = {}
info["arch"] = clean(arch)
info["build_date"] = description_data["date"]
info["channel"] = clean(channel)
info["filename"] = clean(url).split("/")[-1]
info["hash"] = description_data["hash"]
info["name"] = clean(name) + " " + clean(channel)
info["size"] = description_data["size"]
info["type"] = description_data["type"]
info["url"] = clean(url)
info["version"] = (
description_data["name"] + "_" + description_data["hash"]
)
for li in soup.find_all("li", class_="os"):
description_element = li.find("div", class_="name").find("small")
arch = li.find("span", class_="build").find(text=True, recursive=False)
channel = li.find("span", class_="build-var").text
name = li.find("div", class_="name").find(text=True, recursive=False)
url = li.find("a", href=True)["href"]

description_data = parse_description(description_element)
if description_data is None:
continue

info = {}
info["arch"] = clean(arch)
info["build_date"] = description_data["date"]
info["channel"] = clean(channel)
info["filename"] = clean(url).split("/")[-1]
info["hash"] = description_data["hash"]
info["name"] = clean(name) + " " + clean(channel)
info["size"] = description_data["size"]
info["type"] = description_data["type"]
info["url"] = clean(url)
info["version"] = (
description_data["name"] + "_" + description_data["hash"]
)

# Set "os" based on URL
if "windows" in clean(url):
info["os"] = "windows"
elif "darwin" in clean(url):
info["os"] = "osx"
else:
info["os"] = "linux"
# Set "os" based on URL
if "windows" in clean(url):
info["os"] = "windows"
elif "darwin" in clean(url):
info["os"] = "osx"
else:
info["os"] = "linux"

results.append(info)
results.append(info)

finallist = results

Expand Down