Skip to content

A high-performance file streaming service built with Python that allows you to stream files directly from Telegram.

License

Notifications You must be signed in to change notification settings

AshokShau/TgStream

Repository files navigation

TgStream - Telegram File Streaming Service

A high-performance file streaming service built with Python that allows you to stream files directly from Telegram.

Features

  • Stream files directly from Telegram using url
  • Built with asyncio for high performance
  • Containerized with Docker for easy deployment
  • Environment-based configuration
  • Lightweight and efficient

🛠️ Installation

Option 1: Manual Installation

# 1. Install system dependencies
sudo apt-get install python3-pip tmux -y

# 2. Install uv (Python package manager)
pip3 install uv

# 3. Clone the repository
git clone https://github.com/AshokShau/TgStream

cd TgStream

# 4. Create virtual environment
uv venv

# 5. Activate virtual environment
source .venv/bin/activate

# 6. Install dependencies
uv pip install -e .

# 7. Copy and edit environment file
cp sample.env .env
nano .env

# 8. Run the bot
start

Option 2: Docker Deployment (Recommended)

# 1. Build the Docker image
docker build -t tg-stream .

# 2. Run the container (Make sure to create a .env file first)
docker run -d --name songbot --env-file .env tg-stream

Project Structure

TgStream/
├── src/                    # Source code
│   ├── api/               # API endpoints
│   ├── __init__.py        # Package initialization
│   ├── __main__.py        # Entry point
│   └── config.py          # Configuration settings
├── .dockerignore          # Docker ignore file
├── .env                   # Environment variables
├── .gitignore             # Git ignore file
├── Dockerfile             # Docker configuration
├── pyproject.toml         # Project metadata and dependencies
└── README.md              # This file

Usage

http://0.0.0.0:5069/stream?url=https://t.me/username/12345

About

A high-performance file streaming service built with Python that allows you to stream files directly from Telegram.

Topics

Resources

License

Stars

Watchers

Forks