Skip to content

Commit

Permalink
Dont check 07th-mod connectivity for URLOpen/CURL/Aria
Browse files Browse the repository at this point in the history
  • Loading branch information
drojf committed Jul 12, 2024
1 parent 26e704c commit 6c895e7
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions common.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,11 @@ def testCurlHeaders(url, certPath):
paths_to_try = [None, Globals.CA_CERT_PATH, "curl-ca-bundle.crt"]

for certificate_path in paths_to_try:
if not testCurlHeaders('https://07th-mod.com/', certificate_path):
print("chooseCurlCertificate(): Failed to download headers using CURL from 07th-mod.com using cert [{}]".format(certificate_path))
continue

if not testCurlHeaders('https://github.com/', certificate_path):
print("chooseCurlCertificate(): Failed to download headers using CURL from github.com using cert [{}]".format(certificate_path))
continue

print("chooseCurlCertificate(): Will use certificate [{}] when using cURL with 07th-mod and github".format(certificate_path))
print("chooseCurlCertificate(): Will use certificate [{}] when using cURL".format(certificate_path))
Globals.CA_CERT_PATH = certificate_path
return

Expand All @@ -272,15 +268,11 @@ def testURLOpenHeaders(url, certPath):
paths_to_try = [None, Globals.CA_CERT_PATH, "curl-ca-bundle.crt"]

for certificate_path in paths_to_try:
if not testURLOpenHeaders(Request('https://07th-mod.com/', headers={"User-Agent": ""}), certificate_path):
print("chooseURLOpenCertificate(): Failed to download headers using urlOpen from 07th-mod.com using cert [{}]".format(certificate_path))
continue

if not testURLOpenHeaders(Request('https://github.com/', headers={"User-Agent": ""}), certificate_path):
print("chooseURLOpenCertificate(): Failed to download headers using urlOpen from github.com using cert [{}]".format(certificate_path))
continue

print("chooseURLOpenCertificate(): Will use certificate [{}] for URLOpen() on 07th-mod and github".format(certificate_path))
print("chooseURLOpenCertificate(): Will use certificate [{}] for URLOpen()".format(certificate_path))
Globals.URLOPEN_CERT_PATH = certificate_path
return

Expand All @@ -290,7 +282,7 @@ def testURLOpenHeaders(url, certPath):
@staticmethod
def scanForAria():
ariaSearchPaths = ["./aria2c", "./.aria2c", "aria2c"]
Globals.ARIA_EXECUTABLE = findWorkingExecutablePath(ariaSearchPaths, ['https://07th-mod.com/', '--dry-run=true'])
Globals.ARIA_EXECUTABLE = findWorkingExecutablePath(ariaSearchPaths, ['https://github.com/', '--dry-run=true'])

if Globals.ARIA_EXECUTABLE is None:
print("\nWARNING: aria2 failed to download 07th-mod website. Using fallback detection method.")
Expand Down

0 comments on commit 6c895e7

Please sign in to comment.