An open API service indexing awesome lists of open source software.

https://github.com/ashokshau/tgstream

A high-performance file streaming service built with Python that allows you to stream files directly from Telegram.
https://github.com/ashokshau/tgstream

pytdbot python streaming telegram tg

Last synced: 10 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# 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

```bash
# 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)

```bash
# 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

```text
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