This commit is contained in:
doms9 2025-09-15 08:44:57 -04:00
parent bffb4e487f
commit 00000d93a0

View file

@ -167,11 +167,14 @@ async def check_status(client: httpx.AsyncClient, url: str) -> bool:
return r.status_code == 200
async def get_base(client: httpx.AsyncClient, mirrors: list[str]) -> str:
async def get_base(client: httpx.AsyncClient, mirrors: list[str]) -> str | None:
tasks = [check_status(client, link) for link in mirrors]
results = await asyncio.gather(*tasks)
try:
return [url for url, ok in zip(mirrors, results) if ok][0]
except IndexError:
return
def capture_req(