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"
|
||||
HYDRUS_REPO_URL = "https://github.com/hydrusnetwork/hydrus.git"
|
||||
HYDRUS_INSTALLER_SCRIPT_URLS = (
|
||||
"https://raw.githubusercontent.com/hydrusnetwork/hydrus/main/scripts/hydrusnetwork.py",
|
||||
"https://raw.githubusercontent.com/hydrusnetwork/hydrus/master/scripts/hydrusnetwork.py",
|
||||
"https://code.glowers.club/goyimnose/Medios-Macina/raw/branch/main/scripts/hydrusnetwork.py",
|
||||
)
|
||||
|
||||
|
||||
@@ -912,7 +911,9 @@ def main() -> int:
|
||||
last_exc: Exception | None = None
|
||||
for url in HYDRUS_INSTALLER_SCRIPT_URLS:
|
||||
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())
|
||||
return True
|
||||
except Exception as exc:
|
||||
@@ -1179,17 +1180,17 @@ def main() -> int:
|
||||
hydrus_script = 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:
|
||||
temp_hydrus_repo_dir = Path(tempfile.mkdtemp(prefix="mm_hydrus_repo_"))
|
||||
if _clone_repo(HYDRUS_REPO_URL, temp_hydrus_repo_dir, depth=1):
|
||||
hydrus_script = temp_hydrus_repo_dir / "scripts" / "hydrusnetwork.py"
|
||||
temp_hydrus_repo = temp_hydrus_repo_dir
|
||||
temp_mm_repo_dir = Path(tempfile.mkdtemp(prefix="mm_repo_"))
|
||||
if _clone_repo(REPO_URL, temp_mm_repo_dir, depth=1):
|
||||
hydrus_script = temp_mm_repo_dir / "scripts" / "hydrusnetwork.py"
|
||||
temp_hydrus_repo = temp_mm_repo_dir
|
||||
else:
|
||||
shutil.rmtree(temp_hydrus_repo_dir, ignore_errors=True)
|
||||
shutil.rmtree(temp_mm_repo_dir, ignore_errors=True)
|
||||
hydrus_script = None
|
||||
except Exception as e:
|
||||
print(f"Error cloning Hydrus repo: {e}")
|
||||
print(f"Error cloning Medios-Macina repo: {e}")
|
||||
hydrus_script = None
|
||||
|
||||
if hydrus_script and hydrus_script.exists():
|
||||
|
||||
Reference in New Issue
Block a user