Skip to content

technomancer702/xtream-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xtream to M3U Converter

A lightweight Docker-ready service that periodically fetches streams from an Xtream server and generates M3U playlist files.

Features

  • 📺 Live TV - All live channels with EPG support
  • 🎬 VOD - Movies organized by category
  • 📺 Series - TV shows with season/episode organization
  • Scheduled Refresh - Configurable cron-based updates
  • 🐳 Docker Ready - Easy deployment with Docker Compose

Quick Start with Docker

  1. Clone and configure:

    git clone <your-repo>
    cd xtream-converter
  2. Edit docker-compose.yml with your Xtream credentials:

    environment:
      - XTREAM_SERVER=http://your-server.com:port
      - XTREAM_USERNAME=your_username
      - XTREAM_PASSWORD=your_password
  3. Run:

    docker-compose up -d
  4. Your M3U file will be at: ./output/playlist.m3u

Configuration

Environment Variables

Variable Description Default
XTREAM_SERVER Xtream server URL with port Required
XTREAM_USERNAME Xtream username Required
XTREAM_PASSWORD Xtream password Required
OUTPUT_PATH Output directory path ./output
OUTPUT_FILENAME Output filename playlist.m3u
SCHEDULE_ENABLED Enable scheduled refresh true
SCHEDULE_CRON Cron expression for refresh 0 */6 * * * (every 6 hours)
INCLUDE_LIVE Include live TV streams true
INCLUDE_VOD Include VOD/movies true
INCLUDE_SERIES Include TV series true

Config File (Alternative)

Instead of environment variables, you can use a JSON config file:

  1. Copy the example: cp config/config.example.json config/config.json
  2. Edit with your settings
  3. Mount in Docker: -v ./config:/app/config

Running Locally (Without Docker)

# Install dependencies
npm install

# Set environment variables or create config/config.json

# Run
npm start

Schedule Examples

Cron Expression Description
0 */6 * * * Every 6 hours
0 */12 * * * Every 12 hours
0 0 * * * Once daily at midnight
0 */1 * * * Every hour
*/30 * * * * Every 30 minutes

Output

The generated M3U file includes:

  • Extended M3U format (M3U_PLUS)
  • EPG URL for live TV guide data
  • Channel logos
  • Category grouping
  • Proper stream URLs

Example entry:

#EXTINF:-1 tvg-id="channel1" tvg-name="Channel Name" tvg-logo="http://logo.url" group-title="Live - Sports",Channel Name
http://server.com/live/user/pass/123.ts

Docker Commands

# Start in background
docker-compose up -d

# View logs
docker-compose logs -f

# Stop
docker-compose down

# Rebuild after changes
docker-compose up -d --build

License

MIT

About

A lightweight Docker-ready service that periodically fetches streams from an Xtream server and generates M3U playlist files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors