f
This commit is contained in:
@@ -122,8 +122,7 @@ def run(cmd: list[str], quiet: bool = False, debug: bool = False, cwd: Optional[
|
|||||||
REPO_URL = "https://code.glowers.club/goyimnose/Medios-Macina.git"
|
REPO_URL = "https://code.glowers.club/goyimnose/Medios-Macina.git"
|
||||||
HYDRUS_REPO_URL = "https://github.com/hydrusnetwork/hydrus.git"
|
HYDRUS_REPO_URL = "https://github.com/hydrusnetwork/hydrus.git"
|
||||||
HYDRUS_INSTALLER_SCRIPT_URLS = (
|
HYDRUS_INSTALLER_SCRIPT_URLS = (
|
||||||
"https://raw.githubusercontent.com/hydrusnetwork/hydrus/main/scripts/hydrusnetwork.py",
|
"https://code.glowers.club/goyimnose/Medios-Macina/raw/branch/main/scripts/hydrusnetwork.py",
|
||||||
"https://raw.githubusercontent.com/hydrusnetwork/hydrus/master/scripts/hydrusnetwork.py",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -912,7 +911,9 @@ def main() -> int:
|
|||||||
last_exc: Exception | None = None
|
last_exc: Exception | None = None
|
||||||
for url in HYDRUS_INSTALLER_SCRIPT_URLS:
|
for url in HYDRUS_INSTALLER_SCRIPT_URLS:
|
||||||
try:
|
try:
|
||||||
with urllib.request.urlopen(url) as response:
|
# Add a user-agent to avoid being blocked by some servers
|
||||||
|
req = urllib.request.Request(url, headers={"User-Agent": "Medeia-Macina-Installer"})
|
||||||
|
with urllib.request.urlopen(req) as response:
|
||||||
dest.write_bytes(response.read())
|
dest.write_bytes(response.read())
|
||||||
return True
|
return True
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
@@ -1179,17 +1180,17 @@ def main() -> int:
|
|||||||
hydrus_script = None
|
hydrus_script = None
|
||||||
|
|
||||||
if (not hydrus_script or not hydrus_script.exists()) and temp_hydrus_repo is None:
|
if (not hydrus_script or not hydrus_script.exists()) and temp_hydrus_repo is None:
|
||||||
print("Falling back to clone the Hydrus repository to obtain the helper script...")
|
print("Falling back to clone the Medios-Macina repository to obtain the helper script...")
|
||||||
try:
|
try:
|
||||||
temp_hydrus_repo_dir = Path(tempfile.mkdtemp(prefix="mm_hydrus_repo_"))
|
temp_mm_repo_dir = Path(tempfile.mkdtemp(prefix="mm_repo_"))
|
||||||
if _clone_repo(HYDRUS_REPO_URL, temp_hydrus_repo_dir, depth=1):
|
if _clone_repo(REPO_URL, temp_mm_repo_dir, depth=1):
|
||||||
hydrus_script = temp_hydrus_repo_dir / "scripts" / "hydrusnetwork.py"
|
hydrus_script = temp_mm_repo_dir / "scripts" / "hydrusnetwork.py"
|
||||||
temp_hydrus_repo = temp_hydrus_repo_dir
|
temp_hydrus_repo = temp_mm_repo_dir
|
||||||
else:
|
else:
|
||||||
shutil.rmtree(temp_hydrus_repo_dir, ignore_errors=True)
|
shutil.rmtree(temp_mm_repo_dir, ignore_errors=True)
|
||||||
hydrus_script = None
|
hydrus_script = None
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error cloning Hydrus repo: {e}")
|
print(f"Error cloning Medios-Macina repo: {e}")
|
||||||
hydrus_script = None
|
hydrus_script = None
|
||||||
|
|
||||||
if hydrus_script and hydrus_script.exists():
|
if hydrus_script and hydrus_script.exists():
|
||||||
|
|||||||
Reference in New Issue
Block a user