Add Proper .pkg link fallbacks

This commit is contained in:
Mykola Grymalyuk
2022-04-16 09:51:23 -06:00
parent 28769098fd
commit 3e8f28a2db
4 changed files with 37 additions and 4 deletions
+1
View File
@@ -24,6 +24,7 @@ class Constants:
self.repo_link_latest = f"{self.repo_link}/releases/tag/{self.patcher_version}"
self.copyright_date = "Copyright © 2020-2022 Dortania"
self.installer_pkg_url = f"{self.repo_link_latest}/OCLP-Install.pkg"
self.installer_pkg_url_nightly = "https://nightly.link/dortania/OpenCore-Legacy-Patcher/workflows/build-app-wxpython-offline/main/OCLP-Install.pkg"
# OpenCore Versioning
# https://github.com/acidanthera/OpenCorePkg
+10
View File
@@ -410,6 +410,16 @@ def monitor_disk_output(disk):
output = output[-2]
return output
def validate_link(link):
# Check if link is 404
try:
response = requests.head(link, timeout=5)
if response.status_code == 404:
return False
else:
return True
except (requests.exceptions.Timeout, requests.exceptions.TooManyRedirects, requests.exceptions.ConnectionError, requests.exceptions.HTTPError):
return False
def block_os_updaters():
# Disables any processes that would be likely to mess with