Overview
Dispatcharr provides Xtream Codes API compatibility, allowing IPTV players and applications that support the Xtream Codes protocol to connect to Dispatcharr as if it were an Xtream Codes server. This enables compatibility with popular IPTV applications like:- TiviMate
- IPTV Smarters
- Perfect Player
- GSE Smart IPTV
- Kodi (via Xtream Codes add-ons)
- And many more
What is Xtream Codes?
Xtream Codes is a popular IPTV management panel protocol that provides:- User authentication
- Channel categorization
- EPG data
- VOD (Video on Demand) content
- Series/TV show management
- Standardized API endpoints
Xtream Codes API Implementation
Dispatcharr implements the Xtream Codes API with the following features: ✅ Live Streams API - Browse and play live TV channels ✅ VOD API - Access movies and video content ✅ Series API - Browse TV shows and episodes ✅ Category Management - Organize content by categories ✅ User Authentication - Secure access using Dispatcharr accounts ✅ EPG Integration - Electronic program guide data ✅ Stream URLs - Compatible stream formats Implementation Reference:core/xtream_codes.py
Connection Setup
To connect an Xtream Codes-compatible player to Dispatcharr:Get Connection Details
You’ll need:
- Server URL: Your Dispatcharr server address
- Username: Your Dispatcharr username
- Password: Your Dispatcharr password
The server URL should NOT include
/player_api.php - most apps add this automatically.Configure Your IPTV App
In your IPTV application:
- Select Xtream Codes API or Xtream Codes Login
- Enter the server URL (without trailing slash)
- Enter your Dispatcharr username
- Enter your Dispatcharr password
- Save and connect
API Endpoints
Dispatcharr provides these Xtream Codes-compatible endpoints:Authentication & Account Info
Endpoint:GET /player_api.php
Parameters:
username- User’s usernamepassword- User’s password
core/xtream_codes.py:authenticate() (line 116-137)
Get Live Categories
Endpoint:GET /player_api.php?username=XXX&password=XXX&action=get_live_categories
Returns all live TV channel categories.
Response:
core/xtream_codes.py:get_live_categories() (line 180-206)
Get Live Streams
Endpoint:GET /player_api.php?username=XXX&password=XXX&action=get_live_streams
Optional Parameter: category_id - Filter by category
Returns all live channels or channels in a specific category.
Response:
core/xtream_codes.py:get_all_live_streams() (line 236-262)
Stream URL Format
Live Stream URL:http://YOUR_SERVER:9191/live/{username}/{password}/{channel_id}
Example:
core/xtream_codes.py:get_stream_url() (line 264-266)
Get VOD Categories
Endpoint:GET /player_api.php?username=XXX&password=XXX&action=get_vod_categories
Returns all VOD (movies) categories.
Implementation: core/xtream_codes.py:get_vod_categories() (line 276-301)
Get VOD Streams
Endpoint:GET /player_api.php?username=XXX&password=XXX&action=get_vod_streams
Optional Parameter: category_id - Filter by category
Returns all VOD content.
Response:
core/xtream_codes.py:get_vod_streams() (line 303-331)
VOD Stream URL Format
VOD Stream URL:http://YOUR_SERVER:9191/movie/{username}/{password}/{stream_id}.{ext}
Example:
core/xtream_codes.py:get_vod_stream_url() (line 272-274)
Get Series Categories
Endpoint:GET /player_api.php?username=XXX&password=XXX&action=get_series_categories
Returns all TV series categories.
Implementation: core/xtream_codes.py:get_series_categories() (line 361-386)
Get Series
Endpoint:GET /player_api.php?username=XXX&password=XXX&action=get_series
Optional Parameter: category_id - Filter by category
Returns all TV series.
Implementation: core/xtream_codes.py:get_series() (line 388-416)
Get Series Info
Endpoint:GET /player_api.php?username=XXX&password=XXX&action=get_series_info&series_id=XXX
Returns detailed information about a series including all episodes.
Response:
core/xtream_codes.py:get_series_info() (line 418-444)
Episode Stream URL Format
Episode URL:http://YOUR_SERVER:9191/series/{username}/{password}/{episode_id}.{ext}
Example:
core/xtream_codes.py:get_episode_stream_url() (line 268-270)
XMLTV EPG
Endpoint:GET /xmltv.php?username=XXX&password=XXX
Returns EPG data in XMLTV format for authenticated users.
Implementation: apps/output/views.py:generate_m3u() (line 186-191)
Application-Specific Setup
TiviMate
Enter Details
- Name: Dispatcharr (or any name)
- Server URL:
http://YOUR_SERVER_IP:9191 - Username: Your Dispatcharr username
- Password: Your Dispatcharr password
IPTV Smarters Pro
Enter Credentials
- Server URL:
http://YOUR_SERVER_IP:9191 - Username: Your username
- Password: Your password
- Name: Dispatcharr
Perfect Player IPTV
GSE Smart IPTV
M3U vs Xtream Codes
| Feature | M3U Playlist | Xtream Codes API |
|---|---|---|
| Authentication | URL-based | Username/Password |
| Categories | Group titles | Native category support |
| VOD | Limited | Full support with metadata |
| Series | Not supported | Native support |
| EPG | Separate XMLTV | Integrated |
| Updates | Manual refresh | Dynamic |
| User Management | URL-based | User accounts |
| App Support | Universal | Xtream-compatible apps |
User Management
Xtream Codes API uses Dispatcharr’s user authentication system:Creating API Users
Create User Account
In Dispatcharr:
- Go to Settings → Users
- Click Add User
- Set username and password
- Configure permissions
- Assign channel profiles (optional)
Set Access Permissions
Configure what the user can access:
- Live TV channels
- VOD content
- Series content
- Channel profiles
- User level restrictions
User-Specific Content
Xtream Codes API respects Dispatcharr’s user permissions:- Channel Profiles: Users only see channels from assigned profiles
- User Levels: Content filtered by user access level
- Adult Content: Can be hidden per user preference
- Concurrent Streams: Controlled by max connections setting
apps/output/views.py:generate_m3u() (line 130-156)
Authentication Flow
The Xtream Codes client connects to Dispatcharr:Troubleshooting
Authentication Failed
Check:- Username and password are correct
- User account is active in Dispatcharr
- User has necessary permissions
- Server URL is correct (no trailing slash)
No Channels Showing
Verify:- User has assigned channel profiles OR has access to all channels
- Channels are enabled in Dispatcharr
- User level permits access to channels
- Categories are properly configured
Streams Won’t Play
Check:- Stream URL format is correct
- Source stream is accessible
- Stream profile is configured properly
- Network connectivity between client and server
EPG Not Loading
Verify:- EPG sources configured in Dispatcharr
- EPG data has been fetched
- Channels are mapped to EPG data
- XMLTV endpoint is accessible
Connection Timeout
Common Causes:- Firewall blocking port 9191
- Docker network misconfiguration
- Wrong server IP/hostname
- Reverse proxy issues
Security Considerations
Authentication Security
- Credentials are passed in URL parameters (HTTP)
- Use HTTPS/reverse proxy for encrypted transmission
- Implement network-based access controls
- Use strong passwords
- Limit concurrent connections per user
Reverse Proxy with SSL
https://dispatcharr.yourdomain.com as server URL.
Advanced Features
Custom User Agent
The Xtream Codes client supports custom user agents:core/xtream_codes.py:Client.__init__() (line 11-31)
Session Management
Dispatcharr uses persistent HTTP sessions for efficiency:core/xtream_codes.py (line 29-41)