# coflyn/scribdl-py architecture

> Architecture diagram of the GitHub repository coflyn/scribdl-py, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/coflyn/scribdl-py
- Repository: https://github.com/coflyn/scribdl-py

## Overview

Scribd Downloader is a CLI tool that captures Scribd documents or embeds as PDFs. Users provide a URL or a file of URLs, optionally configure page ranges and rendering settings, and receive PDFs plus download history. The sampled source shows configuration loading, URL-to-embed construction, Playwright rendering, page selection, image capture, and temporary-directory cleanup; README capabilities fill in batch processing and PDF output. The excerpt omits some orchestration and conversion code, so those links rely on README statements.

Main entry points: [`main.py`](https://github.com/coflyn/scribdl-py/blob/main/main.py) (Download processor), [`config.ini`](https://github.com/coflyn/scribdl-py/blob/main/config.ini) (Settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and inputs"]
  node_cli["CLI workflow<br/>[main.py]"]
  node_batch["Batch URLs<br/>[main.py]"]
  node_settings["Settings<br/>[config.ini]"]
  node_config["Config loader<br/>[main.py]"]
end

subgraph group_capture["Document capture"]
  node_download["Download processor<br/>[main.py]"]
  node_browser["Browser rendering<br/>[main.py]"]
  node_selection["Page selection<br/>[main.py]"]
  node_capture_pages["Page capture<br/>[main.py]"]
end

subgraph group_output["Files and records"]
  node_temp["Temporary buffers<br/>[main.py]"]
  node_pdf["PDF output<br/>[main.py]"]
  node_history[("Download history<br/>[main.py]")]
end

node_user(("User"))
node_scribd(("Scribd"))

node_user -->|"provides options"| node_cli
node_cli -->|"loads URL list"| node_batch
node_cli -.->|"loads defaults"| node_config
node_settings -->|"sets defaults"| node_config
node_cli -.->|"starts downloads"| node_download
node_download -->|"opens embed"| node_scribd
node_download -->|"renders document"| node_browser
node_download -->|"selects pages"| node_selection
node_download -->|"captures pages"| node_capture_pages
node_capture_pages -->|"writes images"| node_temp
node_temp -->|"converts images"| node_pdf
node_download -->|"records result"| node_history
node_cli -->|"runs concurrently"| node_batch

click node_cli "https://github.com/coflyn/scribdl-py/blob/main/main.py"
click node_batch "https://github.com/coflyn/scribdl-py/blob/main/main.py"
click node_settings "https://github.com/coflyn/scribdl-py/blob/main/config.ini"
click node_config "https://github.com/coflyn/scribdl-py/blob/main/main.py"
click node_download "https://github.com/coflyn/scribdl-py/blob/main/main.py"
click node_browser "https://github.com/coflyn/scribdl-py/blob/main/main.py"
click node_selection "https://github.com/coflyn/scribdl-py/blob/main/main.py"
click node_capture_pages "https://github.com/coflyn/scribdl-py/blob/main/main.py"
click node_temp "https://github.com/coflyn/scribdl-py/blob/main/main.py"
click node_pdf "https://github.com/coflyn/scribdl-py/blob/main/main.py"
click node_history "https://github.com/coflyn/scribdl-py/blob/main/main.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_cli,node_batch,node_settings,node_config,node_user toneBlue
class node_download,node_browser,node_selection,node_capture_pages toneAmber
class node_temp,node_pdf,node_history toneMint
class node_scribd toneIndigo
```

## Components

### CLI and inputs

- [CLI workflow](https://github.com/coflyn/scribdl-py/blob/main/main.py): `main.py`
- [Batch URLs](https://github.com/coflyn/scribdl-py/blob/main/main.py): `main.py`
- [Settings](https://github.com/coflyn/scribdl-py/blob/main/config.ini): `config.ini`
- [Config loader](https://github.com/coflyn/scribdl-py/blob/main/main.py): `main.py`

### Document capture

- [Download processor](https://github.com/coflyn/scribdl-py/blob/main/main.py): `main.py`
- [Browser rendering](https://github.com/coflyn/scribdl-py/blob/main/main.py): `main.py`
- [Page selection](https://github.com/coflyn/scribdl-py/blob/main/main.py): `main.py`
- [Page capture](https://github.com/coflyn/scribdl-py/blob/main/main.py): `main.py`

### Files and records

- [Temporary buffers](https://github.com/coflyn/scribdl-py/blob/main/main.py): `main.py`
- [PDF output](https://github.com/coflyn/scribdl-py/blob/main/main.py): `main.py`
- [Download history](https://github.com/coflyn/scribdl-py/blob/main/main.py): `main.py`

### Other components

- **User**
- **Scribd**

## Connections

- User → CLI workflow: provides options (evidence: `README.md`)
- CLI workflow → Batch URLs: loads URL list (evidence: `README.md`)
- CLI workflow → Config loader: loads defaults (evidence: `main.py`)
- Settings → Config loader: sets defaults (evidence: `main.py`)
- CLI workflow → Download processor: starts downloads (evidence: `main.py`)
- Download processor → Scribd: opens embed (evidence: `main.py`)
- Download processor → Browser rendering: renders document (evidence: `main.py`)
- Download processor → Page selection: selects pages (evidence: `main.py`)
- Download processor → Page capture: captures pages (evidence: `main.py`)
- Page capture → Temporary buffers: writes images (evidence: `main.py`)
- Temporary buffers → PDF output: converts images (evidence: `README.md`)
- Download processor → Download history: records result (evidence: `README.md`)
- CLI workflow → Batch URLs: runs concurrently (evidence: `README.md`)
