streamtg / README.md
dragonxd1's picture
Initial TGStream project: FastAPI backend + React frontend with Telegram streaming
750d1ce
---
title: Streamtg
emoji: 🐠
colorFrom: purple
colorTo: blue
sdk: docker
pinned: false
---
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
# TGStream
TGStream is a personal Telegram movie streaming web app. It lists videos from a private Telegram channel and streams them on demand in the browser using HTTP range requests.
## Backend setup
1. Create a Telegram API app and obtain API_ID and API_HASH.
2. Generate a session string:
```bash
python backend/gen_session.py
```
3. Copy the environment template and fill it:
```bash
copy backend\.env.example backend\.env
```
4. Install backend dependencies:
```bash
pip install -r backend/requirements.txt
```
5. Run the API server:
```bash
uvicorn backend.main:app --reload
```
## Frontend setup
```bash
cd frontend
npm install
npm run dev
```
The frontend expects the backend at http://localhost:8000 by default. Update the Config bar if you run it elsewhere.