Run the bot and video streaming server on your own computer.
- Python 3.11
- A Telegram bot token from @BotFather
- Telegram API ID and API hash from my.telegram.org
Clone the repository and open a terminal in the project folder:
python -m venv .venvActivate the environment:
Windows PowerShell
.\.venv\Scripts\Activate.ps1Windows CMD
.venv\Scripts\activate.batLinux / macOS
source .venv/bin/activateInstall dependencies:
python -m pip install --upgrade pip
pip install -r requirements.txtSet these environment variables before starting the app:
BOT_TOKEN— token from BotFatherAPI_ID— Telegram API IDAPI_HASH— Telegram API hashPUBLIC_BASE_URL— base URL used in links sent by the botMAX_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.
python runner.pyOpen 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.