Fix join_url for absolute paths
This commit is contained in:
4
main.py
4
main.py
@@ -30,7 +30,9 @@ async def fetch(url, tries=0):
|
|||||||
|
|
||||||
|
|
||||||
def join_url(a: str, b: str) -> str:
|
def join_url(a: str, b: str) -> str:
|
||||||
return a.rstrip("/") + "/" + b.lstrip("/")
|
if b.startswith("/"):
|
||||||
|
return a[: a.rfind(".") + a[a.rfind(".") :].find("/")] + b
|
||||||
|
return a.rstrip("/") + "/" + b
|
||||||
|
|
||||||
|
|
||||||
async def traverse(pool: list[str], url: str, verbose=False) -> None:
|
async def traverse(pool: list[str], url: str, verbose=False) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user