# bhumihar4756/master-txt architecture

> Architecture diagram of the GitHub repository bhumihar4756/master-txt, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhumihar4756/master-txt
- Repository: https://github.com/bhumihar4756/master-txt

## Overview

##### Project type and purpose
- This is a standalone Python tool (not a web front-end) designed to download and manage video/PDF content from multiple educational platforms—both DRM-protected and non-DRM.
- It uses a plugin architecture so that each supported platform (e.g., Classplus, Khan GS, Physics Wallah) is implemented in its own module under `plugins/`.

##### File structure
- Top-level files:
- `main.py` – the orchestrator/entrypoint
- `config.py` – constants and environment-variable configuration
- `Dockerfile`, `app.json`, `heroku.yml` – containerization and Heroku deployment
- Directories:
- `plugins/` – each submodule implements a “downloader” plugin
- `master/` – likely output or staging area for downloaded content
- Notice the plugin loader pattern: `main.py` dynamically imports `plugins/*.py`, finds classes or functions that know how to contact each service.

##### README for additional insights
- Quick-start on Heroku implies 12-factor deployment: the tool runs as a container, reads config from env vars, writes to its local filesystem.
- Emphasizes DRM-secured and non-DRM content from multiple platforms.
- Guides customizing `main.py` or `plugins/master.py` for new platforms or command changes.

##### Don’t overthink—capture all logical elements
- Dynamic loading step (e.g., “import plugins/*.py at startup”).
- File tree briefly under components if space allows.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Container Boundary
    subgraph "Container: Docker + Heroku"
        direction TB
        EnvVars["Env Vars"]:::core
        Config["Configuration Module\n(config.py)"]:::core
        Orchestrator["Orchestrator\n(main.py)"]:::core

        subgraph "Plugins Directory"
            direction TB
            InitPkg["Plugin Init Package\n(__init__.py)"]:::plugin
            PluginMaster["Platform Plugin: master\n(master.py)"]:::plugin
            PluginPlaceholder["Other Platform Plugins\n(plugins/1/)"]:::plugin
        end

        subgraph "Output Storage"
            direction TB
            MasterDir["Output Storage Directory\n(master/)"]:::storage
            SampleFile["Sample Output File\n(master.txt)"]:::storage
        end

        EnvVars --> Config
        Config --> Orchestrator
        Orchestrator -->|"import plugins/*.py"| InitPkg
        InitPkg --> PluginMaster
        InitPkg --> PluginPlaceholder
        PluginMaster -->|"HTTP(s) calls"| ExternalPlatforms
        PluginPlaceholder -->|"HTTP(s) calls"| ExternalPlatforms
        PluginMaster --> MasterDir
        PluginPlaceholder --> MasterDir
        MasterDir --> SampleFile
    end

    ExternalPlatforms["External Platforms\n(Classplus, Khan GS, Physics Wallah)"]:::external

    subgraph "Deployment Definitions"
        direction TB
        DockerfileNode["Dockerfile"]:::deploy
        AppJson["app.json"]:::deploy
        HerokuYml["heroku.yml"]:::deploy
    end

    DockerfileNode --> EnvVars
    AppJson --> EnvVars
    HerokuYml --> EnvVars

    %% Click Events
    click Orchestrator "https://github.com/bhumihar4756/master-txt/blob/main/main.py"
    click Config "https://github.com/bhumihar4756/master-txt/blob/main/config.py"
    click InitPkg "https://github.com/bhumihar4756/master-txt/blob/main/plugins/__init__.py"
    click PluginMaster "https://github.com/bhumihar4756/master-txt/blob/main/plugins/master.py"
    click PluginPlaceholder "https://github.com/bhumihar4756/master-txt/tree/main/plugins/1"
    click MasterDir "https://github.com/bhumihar4756/master-txt/tree/main/master/"
    click SampleFile "https://github.com/bhumihar4756/master-txt/blob/main/master.txt"
    click DockerfileNode "https://github.com/bhumihar4756/master-txt/tree/main/Dockerfile"
    click AppJson "https://github.com/bhumihar4756/master-txt/blob/main/app.json"
    click HerokuYml "https://github.com/bhumihar4756/master-txt/blob/main/heroku.yml"

    %% Styles
    classDef core fill:#f9f,stroke:#333,stroke-width:1px;
    classDef plugin fill:#bbf,stroke:#333,stroke-width:1px;
    classDef external fill:#fbf,stroke:#333,stroke-width:1px;
    classDef storage fill:#bfb,stroke:#333,stroke-width:1px;
    classDef deploy fill:#ffb,stroke:#333,stroke-width:1px;
```
