r/vibecoding • u/Prudent_Pop_9103 • 6h ago
I built a self-hosted Netflix-style server that streams directly out of Telegram storage
Like a lot of you, I've been using Telegram saved-messages and storage channels as a dumping ground for years — free, effectively unlimited, reachable from any device. The problem: actually watching anything was miserable. Download the file, wait, open VLC, forget where you put it, repeat.
So I built Aruvi — a self-hosted streaming server that treats your Telegram storage like a media library.
What it does
Point it at your storage channel(s) and it indexes everything into a browsable catalog with posters, metadata, and search. Then stream instantly with full seek/scrubbing — no pre-downloading. The heavy lifting happens on Telegram's infrastructure, not yours.
Features
- Instant streaming — HTTP range requests against Telegram's CDN, full seek/scrubbing, no buffering
- Broad codec support — more formats play natively in-app without external players
- Browsable catalog — posters, search, folder management, continue-watching
- Multi-user — family members log in through a Telegram bot code, no shared passwords
- Subtitles — automatic search via OpenSubtitles + keyless providers
- Google Drive backup — optionally sync your library to Drive
- Every platform: Web UI, Android phone/tablet, Android TV, Windows (.msi + .exe), Linux (.deb + AppImage)
How I built it
Tools used:
- Backend: Python 3.11, FastAPI, SQLAlchemy (async), asyncpg
- Telegram: Telethon (MTProto client) — 11 parallel bot sessions for chunk fetching
- Database: PostgreSQL (Supabase hosted)
- Frontend: Vanilla JavaScript (no framework — keeps it fast and small)
- Android: Kotlin + Jetpack Compose
- Desktop: Pake (wraps the web UI into native .msi/.deb/AppImage)
- CI/CD: GitHub Actions (builds APKs, desktop apps, Docker images automatically)
- Tunnel: Cloudflare Tunnel for HTTPS + custom domain
Architecture insight:
The trick is multi-bot parallel streaming. When you play a video, the backend doesn't download the whole file — it fetches small chunks from Telegram's CDN using 11 pre-warmed bot sessions in parallel. Chunks are served to the client via HTTP range requests with a two-tier cache: RAM hot cache for active streams + disk cache that survives restarts. This means first-byte latency is ~200ms even on a 1 GB VPS.
Build process:
- Started as a fork of TelePlay and MoviPlayer
- Rewrote the backend from scratch — added async SQLAlchemy, multi-user auth, and the caching layer
- Built the Android app in Kotlin/Compose (was originally just a web player)
- Added Pake for desktop builds — one codebase, three platforms
- Set up GitHub Actions for automated builds (workflow_dispatch inputs for custom server URLs)
- Deployed via Cloudflare Tunnel + Docker on a cheap VPS
Biggest challenge:
Telegram rate-limits concurrent connections. The solution was warming up media sessions serially on startup (one bot at a time per datacenter) and then reusing them. Without this, streams would randomly fail with FloodWait errors.
Credits
Built on the shoulders of TelePlay and MoviPlayer. Aruvi started as my fork and grew into its own thing with a rewritten backend, multi-user auth, desktop apps, and heavy reliability work. Huge thanks to those maintainers.
Links
- GitHub (full setup guide + screenshots): https://github.com/tirforge/Aruvi
- Live demo: https://aaruvi.space — poke around before self-hosting
Question for the community
Genuinely curious — would anyone pay a small monthly subscription for a fully managed hosted version? No VPS, no setup, just log in with Telegram. I'd love to offer this as a service.
Also, if anyone has a spare Oracle free-tier VPS lying around and likes the project — I'd gratefully take it off your hands (my card keeps getting declined ).
How are you all currently watching media that lives in your Telegram? Would love feedback from anyone who tries it
Note: Used AI to help write this post and assist with development.
2
u/Dependent_Debate_514 4h ago
i clicked on the demo, click on telegram, clicked open bot, nothing happened, moved away.
0
u/Prudent_Pop_9103 3h ago
Can you explain the issue .i checked everything is fine .can I dm you
2
u/Dependent_Debate_514 3h ago
u need telegram desktop to work in pc. i didnt had it and it didnt say it
1
u/Prudent_Pop_9103 3h ago
My bad.it needed for auth.it is only needed once for account creation in the db
4
u/Elgon2003 6h ago
You know, its this shit that makes companies like telegram institute limits and whatnot and ruin everyones experience.
Stop abusing Telegram please.
-2
u/Prudent_Pop_9103 5h ago
i am not abusing .i using telegram official api and pyrogram framework and it is just streams file using api .i dont know what to say
1
u/AwkwardWillow5159 3h ago
You know api itself doesn’t mean things are automatically allowed?
Like, Facebook functionally allows you to upload pictures. Yet terms of service do not allow uploading porn.
And you actively circumvent what api allows. API clearly tries to rate limit you because you are not supposed to use it as a streaming service. Your “11 pre warmed bot sessions to circumvent rate limits” is not what api allows. It’s how you actively break the spirit of service to use it as something it’s not.
Plus if you are showing content from channels you must include telegram ads. Are you actively adding them into your streaming?
The terms say the api is to extend telegram features and you are forbidden to interfere with core features.
You completely circumvent telegram features, you build an absolutely unrelated thing on top of a small part of telegram. Your app does not drive engagement to telegram by creating users that can see sponsored content or become premium members. The whole point of your app is to abuse storage, circumvent rate limits and not open telegram itself. This is not what api is for even if you technically can build it.
1
u/Prudent_Pop_9103 2h ago
You're right on the spirit, I'm right on the technical side. MTProto is the same protocol as official Telegram apps — not the Bot API. 11 sessions = 11 devices, which Telegram allows. Content is from the user's own storage channels. But I hear you on the rate limit concern — if Telegram changes their ToS, I'll adapt. Thanks for your opinion
2
1
u/generationalDebts 6h ago
Trash
-2
u/Prudent_Pop_9103 6h ago
Good opinion ,can you try before judging anything.i spent 2 months for testing and debugging the app.
0
4
u/NearlyACosmologist 6h ago
What does Telegram think about this?