| 19 | |
| 20 | |
| 21 | def parser() -> argparse.ArgumentParser: |
| 22 | p = argparse.ArgumentParser(description=__doc__ or "fetch pdf") |
| 23 | p.add_argument("--input", required=True, help="Metadata JSON path, JSON string, or raw paper reference.") |
| 24 | p.add_argument("--output", default="", help="Output path for JSON status.") |
| 25 | p.add_argument("--paper-id", default="", help="Canonical paper id if already known.") |
| 26 | p.add_argument("--dest-dir", default="", help="Directory for downloaded PDFs.") |
| 27 | return p |
| 28 | |
| 29 | |
| 30 | def is_pdf_content(data: bytes) -> bool: |