Stirling-Tools/Stirling-PDF · warning · SystemExit

No URLs supplied. Use --urls and/or --urls-file.

Error message

No URLs supplied. Use --urls and/or --urls-file.

What it means

SystemExit raised by download_pdf_samples.py when no URLs were collected after processing --urls and --urls-file arguments. The script requires at least one URL to download; an empty URL set is treated as a usage error.

Source

Thrown at scripts/download_pdf_samples.py:97

        if not clean or clean.startswith("#"):
            return
        if clean not in seen:
            seen.add(clean)
            urls.append(clean)

    for url in args.urls:
        add(url)
    if args.urls_file:
        for file in args.urls_file:
            path = Path(file)
            if not path.exists():
                print(f"[WARN] URL file not found: {file}", file=sys.stderr)
                continue
            with path.open("r", encoding="utf-8") as handle:
                for line in handle:
                    add(line)
    if not urls:
        raise SystemExit("No URLs supplied. Use --urls and/or --urls-file.")
    return urls


def sanitize_filename(name: str) -> str:
    return re.sub(r"[^A-Za-z0-9._-]+", "_", name).strip("_") or "download"


def build_filename(url: str, output_dir: Path) -> Path:
    parsed = urlparse(url)
    candidate = Path(unquote(parsed.path)).name
    if not candidate:
        candidate = "download.pdf"
    candidate = sanitize_filename(candidate)
    if not candidate.lower().endswith(".pdf"):
        candidate += ".pdf"
    target = output_dir / candidate
    if not target.exists():
        return target

View on GitHub (pinned to 9ef20dcab8)

Solutions

  1. Pass at least one URL: --urls https://example.com/sample.pdf.
  2. Verify --urls-file paths exist and contain URLs.
  3. Check for the '[WARN] URL file not found' messages on stderr.
Defensive patterns

Strategy: validation

Validate before calling

# Ensure at least one URL is supplied before running
if not args.urls and not args.urls_file:
    raise SystemExit("No URLs supplied. Use --urls and/or --urls-file.")

Prevention

When it happens

Trigger: Running the script with no --urls and no --urls-file, or with --urls-file pointing to files that are all missing/empty (they are skipped with a warning, leaving urls empty).

Common situations: Forgot to pass --urls. URL files do not exist (warned and skipped). URL files exist but are empty.

Related errors


AI-assisted analysis of Stirling-Tools/Stirling-PDF@9ef20dcab8 (2026-08-13). Data as JSON: /api/errors/79dc3461a2b4cfb6. Report an issue: GitHub.