# hashirama/ofdl architecture

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

- Interactive diagram: https://gitdiagram.com/hashirama/ofdl
- Repository: https://github.com/hashirama/ofdl

## Overview

#### Purpose and Entry Point
OFDL is a desktop Python application for downloading media from OnlyFans subscriptions, including images, videos, highlights, and stories. Its executable entry point is `OFDL.py`, launched with Python 3.9+.

Paths:
- `OFDL.py`
- `README.md`
- `requirements.txt`

#### Desktop UI and User Interaction
The application uses PyQt5 for its graphical interface. The UI is responsible for collecting session-derived authentication values, displaying subscriptions after authentication, and exposing download-related actions. The README identifies an Options window where the user enters required request-header values.

Paths:
- `OFDL.py`
- `settings.json`

#### Authentication and Session Boundary
OFDL does not describe a built-in username/password login flow. Instead, users manually obtain `cookie`, `useragent`, and `x-bc` values from browser developer tools and enter them into the application. These values form the boundary between the local GUI and authenticated OnlyFans HTTP requests.

Likely persisted application/session settings are separated from code in:
- `settings.json`
- `config.json`

#### OnlyFans API / HTTP Integration
`requests` is the network runtime used to call OnlyFans endpoints. The authenticated request headers enable the app to fetch the user’s subscription list and subsequently retrieve media metadata or media URLs for selected content. Remote OnlyFans services are the primary external dependency; downloads are initiated from the local client rather than through a server-side backend.

Paths:
- `OFDL.py`
- `requirements.txt`

#### Subscription Discovery and Media Retrieval Flow
The primary control flow is:
1. Start the PyQt application.
2. Enter or load browser-derived authentication headers.
3. Fetch authenticated subscription data.
4. Select a subscription/content category.
5. Request associated media data and download images, videos, highlights, or stories to local storage.

This is a client-side workflow; authentication material and downloads remain under the local application’s control.

Paths:
- `OFDL.py`
- `module/snafylno.py`

#### Internal Module Boundary
The repository has a small module package area, with `module/snafylno.py` as the only identified supporting implementation file. This likely contains reusable downloader, API, or content-processing logic called by the top-level GUI script. `OFDL.py` is therefore the orchestration layer, while `module/snafylno.py` is the main internal extension boundary.

Paths:
- `OFDL.py`
- `module/snafylno.py`

#### Runtime and Configuration
The material runtime is Python 3.9+ with two declared dependencies: PyQt5 for the desktop UI and requests for HTTP. JSON files provide local configuration/state surfaces and should be treated as sensitive if they contain copied request headers or cookies.

Paths:
- `requirements.txt`
- `config.json`
- `settings.json`

Main entry points: [`OFDL.py`](https://github.com/hashirama/ofdl/blob/master/OFDL.py) (PyQt interface), [`module/snafylno.py`](https://github.com/hashirama/ofdl/blob/master/module/snafylno.py) (Media retrieval), [`settings.json`](https://github.com/hashirama/ofdl/blob/master/settings.json) (Session headers), [`requirements.txt`](https://github.com/hashirama/ofdl/blob/master/requirements.txt) (PyQt5 and requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Local Desktop App"]
  node_entry["Application entry<br/>Python launcher<br/>[OFDL.py]"]
  node_ui["PyQt interface<br/>desktop UI<br/>[OFDL.py]"]
  node_auth["Session headers<br/>auth material<br/>[settings.json]"]
  node_settings["App settings<br/>local state<br/>[config.json]"]
  node_orchestrator["Download orchestration<br/>application flow<br/>[OFDL.py]"]
  node_module["Downloader module<br/>supporting implementation<br/>[snafylno.py]"]
  node_subscriptions["Subscription discovery<br/>API workflow<br/>[OFDL.py]"]
  node_media["Media retrieval<br/>API workflow<br/>[snafylno.py]"]
  node_storage[("Downloaded media<br/>local filesystem")]
  node_python["Python 3.9+<br/>runtime<br/>[requirements.txt]"]
  node_dependencies["PyQt5 and requests<br/>dependencies<br/>[requirements.txt]"]
end

subgraph group_onlyfans["OnlyFans"]
  node_api{{"Authenticated API<br/>remote HTTP service"}}
  node_cdn{{"Media delivery<br/>remote media service"}}
end

node_python -->|"runs"| node_entry
node_dependencies -->|"provides GUI"| node_ui
node_dependencies -->|"provides HTTP"| node_module
node_entry -->|"starts"| node_ui
node_settings -->|"loads or persists"| node_auth
node_ui -->|"collects"| node_auth
node_ui -->|"initiates actions"| node_orchestrator
node_orchestrator -->|"delegates"| node_module
node_auth -->|"authorizes"| node_subscriptions
node_subscriptions -->|"fetches subscriptions"| node_api
node_ui -->|"selects content"| node_media
node_module -->|"processes"| node_media
node_auth -->|"sends request headers"| node_api
node_media -->|"requests metadata"| node_api
node_media -->|"downloads assets"| node_cdn
node_media -->|"saves"| node_storage

click node_entry "https://github.com/hashirama/ofdl/blob/master/OFDL.py"
click node_ui "https://github.com/hashirama/ofdl/blob/master/OFDL.py"
click node_auth "https://github.com/hashirama/ofdl/blob/master/settings.json"
click node_settings "https://github.com/hashirama/ofdl/blob/master/config.json"
click node_orchestrator "https://github.com/hashirama/ofdl/blob/master/OFDL.py"
click node_module "https://github.com/hashirama/ofdl/blob/master/module/snafylno.py"
click node_subscriptions "https://github.com/hashirama/ofdl/blob/master/OFDL.py"
click node_media "https://github.com/hashirama/ofdl/blob/master/module/snafylno.py"
click node_python "https://github.com/hashirama/ofdl/blob/master/requirements.txt"
click node_dependencies "https://github.com/hashirama/ofdl/blob/master/requirements.txt"

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_entry,node_ui,node_auth,node_settings,node_orchestrator,node_module,node_subscriptions,node_media,node_storage,node_python,node_dependencies toneBlue
class node_api,node_cdn toneAmber
```

## Components

### Local Desktop App

- [Application entry](https://github.com/hashirama/ofdl/blob/master/OFDL.py): Python launcher · Starts the PyQt desktop workflow. · `OFDL.py`
- [PyQt interface](https://github.com/hashirama/ofdl/blob/master/OFDL.py): desktop UI · Collects headers, shows subscriptions, and exposes download actions. · `OFDL.py`
- [Session headers](https://github.com/hashirama/ofdl/blob/master/settings.json): auth material · Browser-derived cookie, user agent, and x-bc values. · `settings.json`
- [App settings](https://github.com/hashirama/ofdl/blob/master/config.json): local state · Local configuration may contain sensitive session data. · `config.json`
- [Download orchestration](https://github.com/hashirama/ofdl/blob/master/OFDL.py): application flow · Coordinates discovery, selection, retrieval, and saving. · `OFDL.py`
- [Downloader module](https://github.com/hashirama/ofdl/blob/master/module/snafylno.py): supporting implementation · Reusable API, download, or content-processing boundary. · `module/snafylno.py`
- [Subscription discovery](https://github.com/hashirama/ofdl/blob/master/OFDL.py): API workflow · `OFDL.py`
- [Media retrieval](https://github.com/hashirama/ofdl/blob/master/module/snafylno.py): API workflow · Retrieves selected images, videos, highlights, and stories. · `module/snafylno.py`
- **Downloaded media**: local filesystem
- [Python 3.9+](https://github.com/hashirama/ofdl/blob/master/requirements.txt): runtime · `requirements.txt`
- [PyQt5 and requests](https://github.com/hashirama/ofdl/blob/master/requirements.txt): dependencies · Provides the GUI and authenticated HTTP client. · `requirements.txt`

### OnlyFans

- **Authenticated API**: remote HTTP service · Provides subscriptions and media metadata or URLs.
- **Media delivery**: remote media service · Serves downloadable media assets.

## Connections

- Python 3.9+ → Application entry: runs
- PyQt5 and requests → PyQt interface: provides GUI
- PyQt5 and requests → Downloader module: provides HTTP
- Application entry → PyQt interface: starts
- App settings → Session headers: loads or persists
- PyQt interface → Session headers: collects
- PyQt interface → Download orchestration: initiates actions
- Download orchestration → Downloader module: delegates
- Session headers → Subscription discovery: authorizes
- Subscription discovery → Authenticated API: fetches subscriptions
- PyQt interface → Media retrieval: selects content
- Downloader module → Media retrieval: processes
- Session headers → Authenticated API: sends request headers
- Media retrieval → Authenticated API: requests metadata
- Media retrieval → Media delivery: downloads assets
- Media retrieval → Downloaded media: saves
