# tushar557845/tushar-drm-txt-uploader architecture

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

- Interactive diagram: https://gitdiagram.com/tushar557845/tushar-drm-txt-uploader
- Repository: https://github.com/tushar557845/tushar-drm-txt-uploader

## Overview

This repository is a Telegram bot for turning submitted text link lists into downloadable and uploaded media files. Users start an upload command, provide a text file and processing options, and the bot processes its entries before sending results back through Telegram. The main file also implements status, stop/restart, and owner-managed sudo commands. Supporting code handles downloads, decryption, media/PDF work, and progress updates. README documents the bot’s command set; sampled excerpts show only parts of the processing branches, so unsampled relationships are omitted.

Main entry points: [`main.py`](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/main.py) (Link processing), [`helper.py`](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/helper.py) (Media downloads), [`p_bar.py`](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/p_bar.py) (Progress updates), [`config.py`](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/config.py) (Bot configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bot["Telegram bot"]
  node_commands["Bot commands<br/>[main.py]"]
  node_access["Sudo management<br/>[main.py]"]
  node_upload["Text upload<br/>[main.py]"]
  node_options["Batch options<br/>[main.py]"]
  node_linkprocessing["Link processing<br/>[main.py]"]
  node_resultdelivery["Result delivery<br/>[main.py]"]
end

subgraph group_processing["Media processing"]
  node_media["Media downloads<br/>[helper.py]"]
  node_drm["DRM decryption<br/>[helper.py]"]
  node_video["Video upload prep<br/>[helper.py]"]
  node_pdf["PDF processing<br/>[helper.py]"]
  node_video_info["Video metadata<br/>[get_video_info.py]"]
end

subgraph group_support["Runtime support"]
  node_progress["Progress updates<br/>[p_bar.py]"]
  node_configuration["Bot configuration<br/>[config.py]"]
  node_logging["Logging<br/>[logger.py]"]
end

subgraph group_web["HTTP endpoint"]
  node_webapp["Health endpoint<br/>[app.py]"]
end

node_user(("Telegram user"))
node_telegram{{"Telegram API"}}
node_webclient(("HTTP client"))

node_user -->|"sends commands"| node_commands
node_commands -->|"checks permissions"| node_access
node_user -->|"submits file"| node_upload
node_upload -->|"requests options"| node_options
node_options -->|"configures batch"| node_linkprocessing
node_linkprocessing -->|"downloads files"| node_media
node_linkprocessing -->|"requests decryption"| node_drm
node_linkprocessing -->|"downloads PDFs"| node_pdf
node_drm -->|"prepares video"| node_video
node_linkprocessing -->|"sends results"| node_resultdelivery
node_resultdelivery -->|"uploads documents"| node_telegram
node_media -->|"updates progress"| node_progress
node_video -->|"sends video"| node_telegram
node_linkprocessing -->|"reads settings"| node_configuration
node_linkprocessing -->|"uses logger"| node_logging
node_webclient -->|"requests health"| node_webapp

click node_commands "https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/main.py"
click node_access "https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/main.py"
click node_upload "https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/main.py"
click node_options "https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/main.py"
click node_linkprocessing "https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/main.py"
click node_resultdelivery "https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/main.py"
click node_media "https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/helper.py"
click node_drm "https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/helper.py"
click node_video "https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/helper.py"
click node_pdf "https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/helper.py"
click node_video_info "https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/get_video_info.py"
click node_progress "https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/p_bar.py"
click node_configuration "https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/config.py"
click node_logging "https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/logger.py"
click node_webapp "https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/app.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_commands,node_access,node_upload,node_options,node_linkprocessing,node_resultdelivery,node_user,node_webclient toneBlue
class node_media,node_drm,node_video,node_pdf,node_video_info toneAmber
class node_progress,node_configuration,node_logging,node_telegram toneMint
class node_webapp toneRose
```

## Components

### Telegram bot

- [Bot commands](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/main.py): `main.py`
- [Sudo management](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/main.py): `main.py`
- [Text upload](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/main.py): `main.py`
- [Batch options](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/main.py): `main.py`
- [Link processing](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/main.py): `main.py`
- [Result delivery](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/main.py): `main.py`

### Media processing

- [Media downloads](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/helper.py): `helper.py`
- [DRM decryption](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/helper.py): `helper.py`
- [Video upload prep](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/helper.py): `helper.py`
- [PDF processing](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/helper.py): `helper.py`
- [Video metadata](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/get_video_info.py): `get_video_info.py`

### Runtime support

- [Progress updates](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/p_bar.py): `p_bar.py`
- [Bot configuration](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/config.py): `config.py`
- [Logging](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/logger.py): `logger.py`

### HTTP endpoint

- [Health endpoint](https://github.com/tushar557845/tushar-drm-txt-uploader/blob/main/app.py): `app.py`

### Other components

- **Telegram user**
- **Telegram API**
- **HTTP client**

## Connections

- Telegram user → Bot commands: sends commands (evidence: `README.md`)
- Bot commands → Sudo management: checks permissions (evidence: `main.py`)
- Telegram user → Text upload: submits file (evidence: `main.py`)
- Text upload → Batch options: requests options (evidence: `main.py`)
- Batch options → Link processing: configures batch (evidence: `main.py`)
- Link processing → Media downloads: downloads files (evidence: `main.py`)
- Link processing → DRM decryption: requests decryption (evidence: `main.py`)
- Link processing → PDF processing: downloads PDFs (evidence: `main.py`)
- DRM decryption → Video upload prep: prepares video (evidence: `helper.py`)
- Link processing → Result delivery: sends results (evidence: `main.py`)
- Result delivery → Telegram API: uploads documents (evidence: `main.py`)
- Media downloads → Progress updates: updates progress (evidence: `helper.py`)
- Video upload prep → Telegram API: sends video (evidence: `helper.py`)
- Link processing → Bot configuration: reads settings (evidence: `main.py`)
- Link processing → Logging: uses logger (evidence: `main.py`)
- HTTP client → Health endpoint: requests health (evidence: `app.py`)
