87 lines
2.4 KiB
Markdown
87 lines
2.4 KiB
Markdown
# Xtream Player (Java + com.sun.httpserver)
|
|
|
|
Self-hosted HTML5 app for Xtream IPTV:
|
|
- **User authentication** - Built-in login with username/password (stored in H2 database)
|
|
- provider settings/login
|
|
- manual source preload (button `Load sources`) with progress bar
|
|
- sources are stored in local H2 DB and the UI reads them only through local API
|
|
- tabs for `Live`, `VOD`, `Series`, and `Custom streams`
|
|
- search + filtering
|
|
- EPG (`get_short_epg`) for live channels
|
|
- playback of Xtream streams and custom URLs
|
|
|
|
## Requirements
|
|
- Java 17+
|
|
- Maven 3.9+
|
|
|
|
## Run
|
|
```bash
|
|
mvn -q compile exec:java
|
|
```
|
|
|
|
The app runs on:
|
|
- `http://localhost:8080`
|
|
|
|
Default login credentials (first run):
|
|
- **Username**: `admin`
|
|
- **Password**: `admin`
|
|
|
|
Optional: change port:
|
|
```bash
|
|
PORT=8090 mvn -q compile exec:java
|
|
```
|
|
|
|
## User Management
|
|
|
|
User management is now available via `/user` CRUD API protected by a fixed bearer token:
|
|
- Bearer token: `MujBearer852654`
|
|
|
|
```bash
|
|
# List users
|
|
curl -H "Authorization: Bearer MujBearer852654" \
|
|
http://localhost:8080/user
|
|
|
|
# Get one user
|
|
curl -H "Authorization: Bearer MujBearer852654" \
|
|
"http://localhost:8080/user?username=admin"
|
|
|
|
# Create user
|
|
curl -X POST -H "Authorization: Bearer MujBearer852654" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"username":"user","password":"pass123"}' \
|
|
http://localhost:8080/user
|
|
|
|
# Update password
|
|
curl -X PUT -H "Authorization: Bearer MujBearer852654" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"username":"user","newPassword":"newPass123"}' \
|
|
http://localhost:8080/user
|
|
|
|
# Delete user
|
|
curl -X DELETE -H "Authorization: Bearer MujBearer852654" \
|
|
"http://localhost:8080/user?username=user"
|
|
```
|
|
|
|
See [USERS_MANAGEMENT.md](USERS_MANAGEMENT.md) for detailed user management documentation.
|
|
|
|
## Docker (JRE 17)
|
|
Build image:
|
|
```bash
|
|
docker build -t xtream-player:latest .
|
|
```
|
|
|
|
Run container:
|
|
```bash
|
|
docker run --rm -p 8080:8080 \
|
|
-e PORT=8080 \
|
|
-v xtream-player-data:/home/app/.xtream-player \
|
|
xtream-player:latest
|
|
```
|
|
|
|
## Notes
|
|
- Config is stored in `~/.xtream-player/config.properties`.
|
|
- User credentials are stored in `~/.xtream-player/users.db` (H2 database).
|
|
- Preloaded sources (live/vod/series categories + lists) are stored in `~/.xtream-player/library/xtream-sources.mv.db`.
|
|
- Custom streams are stored in browser `localStorage`.
|
|
- Some Xtream servers/streams may not be browser-friendly (for example `ts`). `m3u8` is usually better for browsers.
|