Skip to content

About

Telegram bot to generate streaming link for TG videos or from YouTube & direct download links of videos. Videos will be hosted on the app server.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

65 Commits

Folders and files

Repository files navigation

Telegram Video Streaming Bot (Local)

Run the bot and video streaming server on your own computer.

Requirements

Install

Clone the repository and open a terminal in the project folder:

python -m venv .venv

Activate the environment:

Windows PowerShell

.\.venv\Scripts\Activate.ps1

Windows CMD

.venv\Scripts\activate.bat

Linux / macOS

source .venv/bin/activate

Install dependencies:

python -m pip install --upgrade pip
pip install -r requirements.txt

Configure

Set these environment variables before starting the app:

  • BOT_TOKEN — token from BotFather
  • API_ID — Telegram API ID
  • API_HASH — Telegram API hash
  • PUBLIC_BASE_URL — base URL used in links sent by the bot
  • MAX_VIDEO_SIZE — optional maximum video size in bytes (default: 2 GiB)

For local use on the same computer, set PUBLIC_BASE_URL to:

http://127.0.0.1:8000

Windows PowerShell example:

$env:BOT_TOKEN = "YOUR_BOT_TOKEN"
$env:API_ID = "YOUR_API_ID"
$env:API_HASH = "YOUR_API_HASH"
$env:PUBLIC_BASE_URL = "http://127.0.0.1:8000"

If you open the bot's generated links from another device, 127.0.0.1 will point to that other device, not the computer running this project. In that case, set PUBLIC_BASE_URL to an address reachable by that device (for example, your computer's LAN IP), and allow the server port through your firewall. For access over the internet, use a secure tunnel or a properly configured public reverse proxy.

Start

python runner.py

Open the local web interface at:

http://127.0.0.1:8000

Stop the application with Ctrl+C.

The server binds to 127.0.0.1:8000 by default. You can override this with the optional HOST and PORT environment variables.

About

Telegram bot to generate streaming link for TG videos or from YouTube & direct download links of videos. Videos will be hosted on the app server.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages