feat(download_imageset): Extend intercepted hosts

This commit is contained in:
abdus committed 2026-10-04 08:27:02 +02:00
1 parent 9a3b78105e
commit f4764699e8
1 file changed
+4 -1
+4 -1
View File
@@ -391,6 +391,9 @@ def filehost_cmd(urls: tuple[str, ...], name: str | None, cwd: Path, token: str)
_extract_and_process(output_dir) _extract_and_process(output_dir)
def is_filehost(url: str) -> bool:
kws = ["rg.to", "rapidgator.net", "trbt.cc"]
return any(kw in url for kw in kws)
@cli.command("download") @cli.command("download")
@click.argument("urls", nargs=-1, required=True) @click.argument("urls", nargs=-1, required=True)
@@ -401,7 +404,7 @@ def filehost_cmd(urls: tuple[str, ...], name: str | None, cwd: Path, token: str)
def download_cmd( def download_cmd(
ctx: click.Context, urls: tuple[str, ...], name: str | None, cwd: Path, token: str ctx: click.Context, urls: tuple[str, ...], name: str | None, cwd: Path, token: str
) -> None: ) -> None:
filehost_urls = [u for u in urls if "rg.to" in u or "rapidgator.net" in u] filehost_urls = [u for u in urls if is_filehost(u)]
gallery_urls = [u for u in urls if u not in set(filehost_urls)] gallery_urls = [u for u in urls if u not in set(filehost_urls)]
if filehost_urls: if filehost_urls:
ctx.invoke(filehost_cmd, urls=tuple(filehost_urls), name=name, cwd=cwd, token=token) ctx.invoke(filehost_cmd, urls=tuple(filehost_urls), name=name, cwd=cwd, token=token)