# sharmayash263/-web-to-pdf-automation-script architecture

> Architecture diagram of the GitHub repository sharmayash263/-web-to-pdf-automation-script, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sharmayash263/-web-to-pdf-automation-script
- Repository: https://github.com/sharmayash263/-web-to-pdf-automation-script

## Overview

This is a command-line web-to-PDF extraction script. The user supplies a series URL and chooses one issue, a range, or all issues; the script opens a persistent browser session, extracts and filters the series listing, visits each selected issue, captures and checks page images, compiles them into a PDF, and removes temporary images after success. The README also describes mirror handling and manual security-challenge resolution. The architecture is based on the single sampled source file; these stages are responsibilities within that script, not separate modules.

Main entry points: [`comic_B.py`](https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py) (CLI workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User and browser"]
  node_runner["CLI workflow<br/>[comic_B.py]"]
  node_browser["Persistent browser<br/>[comic_B.py]"]
end

subgraph group_extraction["Issue extraction"]
  node_listing["Issue listing<br/>[comic_B.py]"]
  node_selection["Issue selection<br/>[comic_B.py]"]
  node_challenge["Challenge check<br/>[comic_B.py]"]
  node_capture["Image capture<br/>[comic_B.py]"]
  node_quality["Image retry check<br/>[comic_B.py]"]
end

subgraph group_output["PDF output"]
  node_pdf["PDF compilation<br/>[comic_B.py]"]
  node_cleanup["Temporary cleanup<br/>[comic_B.py]"]
end

node_user(("User"))
node_site["Reading site"]
node_converter["img2pdf"]

node_user -->|"provides choices"| node_runner
node_runner -->|"launches"| node_browser
node_browser -->|"navigates"| node_site
node_runner -->|"extracts links"| node_listing
node_runner -->|"filters issues"| node_selection
node_runner -->|"checks challenges"| node_challenge
node_runner -->|"captures pages"| node_capture
node_runner -->|"retries small images"| node_quality
node_runner -->|"compiles images"| node_pdf
node_pdf -->|"converts images"| node_converter
node_runner -->|"deletes images"| node_cleanup

click node_runner "https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py"
click node_browser "https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py"
click node_listing "https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py"
click node_selection "https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py"
click node_challenge "https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py"
click node_capture "https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py"
click node_quality "https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py"
click node_pdf "https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py"
click node_cleanup "https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_runner,node_browser,node_user toneBlue
class node_listing,node_selection,node_challenge,node_capture,node_quality toneAmber
class node_pdf,node_cleanup toneMint
class node_site,node_converter toneIndigo
```

## Components

### User and browser

- [CLI workflow](https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py): `comic_B.py`
- [Persistent browser](https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py): `comic_B.py`

### Issue extraction

- [Issue listing](https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py): `comic_B.py`
- [Issue selection](https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py): `comic_B.py`
- [Challenge check](https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py): `comic_B.py`
- [Image capture](https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py): `comic_B.py`
- [Image retry check](https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py): `comic_B.py`

### PDF output

- [PDF compilation](https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py): `comic_B.py`
- [Temporary cleanup](https://github.com/sharmayash263/-web-to-pdf-automation-script/blob/main/comic_B.py): `comic_B.py`

### Other components

- **User**
- **Reading site**
- **img2pdf**

## Connections

- User → CLI workflow: provides choices (evidence: `comic_B.py`)
- CLI workflow → Persistent browser: launches (evidence: `comic_B.py`)
- Persistent browser → Reading site: navigates (evidence: `comic_B.py`)
- CLI workflow → Issue listing: extracts links (evidence: `comic_B.py`)
- CLI workflow → Issue selection: filters issues (evidence: `comic_B.py`)
- CLI workflow → Challenge check: checks challenges (evidence: `comic_B.py`)
- CLI workflow → Image capture: captures pages (evidence: `comic_B.py`)
- CLI workflow → Image retry check: retries small images (evidence: `comic_B.py`)
- CLI workflow → PDF compilation: compiles images (evidence: `comic_B.py`)
- PDF compilation → img2pdf: converts images (evidence: `comic_B.py`)
- CLI workflow → Temporary cleanup: deletes images (evidence: `comic_B.py`)
