Your personal, self-hosted media server ā powered by Telegram.

Stream and manage your Telegram files on any device ā TV, Mobile, or Browser ā without downloading the entire file. TelePlay uses Telegram as unlimited cloud storage and streams content on-demand at high speed using its multi-client parallel download technology. Upload via a Telegram Bot, organize through a Web App, and watch anywhere.
/myfiles/webAUTH_USERS You Telegram Cloud Your Server Your Devices
āāā āāāāāāāāāāāāāā āāāāāāāāāāā āāāāāāāāāāāā
ā ā
ā 1. Send file to Bot āāāāāāāāāāāāāāāāāāāāāāāāāāāŗ ā
ā 2. Bot forwards to āāāāŗ ā (Private Channel)
ā Storage Channel ā
ā ā 3. Saves metadata
ā ā to Database
ā ā
ā 4. Open Web / TV App āāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā
ā 5. Press Play āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāŗ ā
ā 6. Fetches chunks āāā ā (from Telegram)
ā 7. Streams to you āāāāāāāāāāāāāāāāāāāāāāāāāāā ā
ā ā
Your files are never stored on your server ā TelePlay streams them directly from Telegram's cloud on demand.
| Requirement | How to get it |
|---|---|
| Telegram Bot Token | Create via @BotFatherā |
| API ID & Hash | Register at my.telegram.orgā |
| Storage Channel | Create a private channel, add your bot as admin |
| Docker | Install Dockerā |
git clone https://github.com/yourusername/teleplay.git
cd teleplay
cp .env.example .env
Edit .env with your credentials:
TELEGRAM_API_ID=12345678
TELEGRAM_API_HASH=abcdef1234567890abcdef1234567890
TELEGRAM_BOT_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
TELEGRAM_STORAGE_CHANNEL_ID=-100xxxxxxxxxx
JWT_SECRET=your-super-secret-key-at-least-32-characters
# Use PostgreSQL (recommended) or SQLite (no setup needed):
DATABASE_URL=sqlite:///./data/teleplay.db
# DATABASE_URL=postgresql://postgres:password@db:5432/teleplay
docker compose up -d
That's it! Your services are now running:
| Service | URL |
|---|---|
| Web App | http://localhostā |
| Backend API | http://localhost:8000ā |
/web to get a link to your Web App.For detailed setup, usage, and login instructions, see the Setup & Usage Guideā .
For VPS, Railway, Render, and CapRover deployments, see the Deployment Guideā .
Download the APK from the Releasesā page:
| APK | Best For |
|---|---|
arm64-v8a | Modern TV boxes, phones, NVIDIA Shield |
universal | Any device (if unsure, use this one) |
Setup:
http://192.168.1.100)./login CODE to your bot.For APK signing and release automation, see the Releasing Guideā .
| Variable | Required | Description |
|---|---|---|
TELEGRAM_API_ID | ā | From my.telegram.orgā |
TELEGRAM_API_HASH | ā | From my.telegram.orgā |
TELEGRAM_BOT_TOKEN | ā | From @BotFatherā |
TELEGRAM_STORAGE_CHANNEL_ID | ā | Private channel ID (starts with -100) |
JWT_SECRET | ā | Secret key for JWT signing (min 32 chars) |
DATABASE_URL | ā | Database connection URL (see below) |
WEB_BASE_URL | ā | Public URL of the web app |
TELEGRAM_HELPER_BOT_TOKENS | ā | Extra bot tokens for parallel downloadsā |
AUTH_USERS | ā | Comma-separated Telegram IDs for restricted access |
š” DATABASE_URL Options:
- PostgreSQL (recommended):
postgresql://postgres:password@localhost:5432/teleplay- SQLite (no setup needed):
sqlite:///./data/teleplay.dbUse SQLite if you don't want to set up PostgreSQL ā it works out of the box for small deployments.
| Layer | Technology |
|---|---|
| Backend | Python 3.11+, FastAPI, Uvicorn |
| Telegram | PyroTGFork (MTProto) |
| Database | PostgreSQL (prod) / SQLite (dev), SQLAlchemy 2.0 |
| Auth | JWT (Access + Refresh Tokens) |
| Web | React 18, TypeScript, Vite |
| Android | Kotlin, Jetpack Compose for TV, ExoPlayer |
| Deploy | Docker, Docker Compose, Nginx |
teleplay/
āāā backend/ # Python backend (FastAPI + Bot)
ā āāā app/
ā ā āāā routers/ # API endpoints (auth, files, folders, streaming, tv)
ā ā āāā bot.py # Telegram bot command handlers
ā ā āāā streaming.py # Multi-client parallel streaming engine
ā ā āāā models.py # SQLAlchemy ORM models
ā ā āāā main.py # FastAPI app entry point
ā āāā Dockerfile
ā āāā requirements.txt
āāā web/ # React web interface
ā āāā src/
ā ā āāā components/ # UI components
ā ā āāā lib/api.ts # API client & hooks
ā ā āāā App.tsx # Main app with routing
ā āāā Dockerfile
āāā android/ # Android TV & Mobile app
ā āāā app/src/main/java/ # Kotlin (Compose + ExoPlayer)
āāā docs/ # Documentation
ā āāā ARCHITECTURE.md # Technical deep-dive
ā āāā DEPLOYMENT.md # Deployment guide
ā āāā SETUP.md # Setup & usage guide
ā āāā RELEASING.md # APK release process
āāā docker-compose.yml
āāā .env.example
cd backend
python -m venv venv
venv\Scripts\activate # Linux/Mac: source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # Edit with your credentials
uvicorn app.main:app --reload
cd web
npm install
npm run dev
Open the android/ folder in Android Studio and build.
AUTH_USERSā whitelist| Guide | Description |
|---|---|
| Setup & Usageā | How the app works, bot commands, login methods, and troubleshooting |
| Deploymentā | Docker, VPS, Railway, Render, and CapRover deployment |
| Architectureā | Technical deep-dive: streaming engine, API endpoints, database models |
| Releasingā | APK build automation and signing via GitHub Actions |
Contributions are welcome! Please see CONTRIBUTING.mdā for guidelines.
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License ā see the LICENSEā file for details.
Content type
Image
Digest
sha256:f3ef64cddā¦
Size
25.1 MB
Last updated
about 2 months ago
docker pull birdxs/teleplay:web-latest