Guides

Connecting devices

This document lists the URL forms that the panel serves to subscribers.

Before you start

  • A subscriber line with a user name and a password, created in the panel.
  • The host of your panel: the domain or the IP address of the main server.
  • The HTTP port you chose at installation. With the default 80 you can leave the port out of every URL. The panel serves the same paths on port 80 and on port 8080. With a custom port, add :<port> after the host.
  • For MAG devices: the MAC address of the device, registered in the panel.

In all examples replace <host> with your host (and port), <user> with the user name and <pass> with the password of the line.

1. Apps that use the Xtream Codes API

Enter three values in the app:

FieldValue
Server URLhttp://<host> or http://<host>:<port>
Username<user>
Password<pass>

The app then calls:

text
http://<host>/player_api.php?username=<user>&password=<pass>

Supported action values: get_live_categories, get_live_streams, get_vod_categories, get_vod_streams, get_series_categories, get_series, get_series_info, get_vod_info, get_short_epg, get_simple_data_table.

Further parameters used by these actions: category_id, series_id, vod_id, stream_id, limit.

2. M3U playlist

text
http://<host>/get.php?username=<user>&password=<pass>&type=m3u_plus&output=ts
ParameterValuesDefault
typem3u_plus for an M3U playlist. dreambox, enigma16 and enigma22_script for Enigma2 receivers (section 5).m3u_plus
outputts, hls or m3u8.ts
live0 leaves out live channels.included
vod0 leaves out movies.included
series0 leaves out series.included
radio0 leaves out radio.included

Notes:

  • The playlist is sent as a download named playlist.m3u.
  • Live entries in the M3U playlist always end in .ts. The output parameter changes the stream URLs in the Enigma2 playlist types.
  • Stream URLs inside the playlist start with http://, also when the playlist itself was requested over HTTPS.
  • The host name inside the playlist comes from the panel configuration: a DNS name set for the line or its reseller, otherwise the address and port of the main server.

3. Direct stream URLs

ContentURL form
Live channel, MPEG-TShttp://<host>/live/<user>/<pass>/<stream-id>.ts
Live channel, HLShttp://<host>/live/<user>/<pass>/<stream-id>.m3u8
Live channel, short formhttp://<host>/<user>/<pass>/<stream-id>
Moviehttp://<host>/movie/<user>/<pass>/<stream-id>.<ext>
Series episodehttp://<host>/series/<user>/<pass>/<stream-id>.<ext>
Timeshifthttp://<host>/timeshift/<user>/<pass>/<duration>/<start>/<stream-id>.ts

<ext> is the container of the file, for example mp4 or mkv. A player gets these URLs from the playlist or from the API and does not need them typed in by hand.

When a stream runs on a load balancer, the main server answers with a redirect (HTTP 302) to that server. The player must follow redirects.

4. EPG (programme guide)

text
http://<host>/xmltv.php?username=<user>&password=<pass>

The panel has an optional setting that requires an extra token parameter for this URL. With that setting on and no valid token, the answer is Valid token required.

5. Enigma2 receivers

Playlist types of get.php:

text
http://<host>/get.php?username=<user>&password=<pass>&type=enigma22_script&output=ts
http://<host>/get.php?username=<user>&password=<pass>&type=dreambox&output=ts
http://<host>/get.php?username=<user>&password=<pass>&type=enigma16&output=ts

type=enigma22_script returns an install script as a download named enigma2_install.sh.

API for Enigma2 plugins:

text
http://<host>/enigma2.php?username=<user>&password=<pass>&type=get_live_categories

Supported type values: get_live_categories, get_live_streams, get_vod_categories, get_vod_streams, get_series_categories, get_series, get_series_info.

Setup scripts generated by the panel:

URLContent
http://<host>/play/enigma-setup-script?token=<token>Full shell installer.
http://<host>/play/enigma-simple-setup-script?token=<token>Bouquet only installer.
http://<host>/play/enigma-python-script?token=<token>Python script.

The panel creates a setup link with a token for a line. The token is valid for 24 hours and stops working when the line password changes. On the receiver the link is used like this:

bash
wget -qO- 'http://<host>/play/enigma-setup-script?token=<token>' | bash

The three script URLs also accept username=<user>&password=<pass> in place of the token.

6. MAG devices (Stalker portal)

Enter this portal URL in the device settings:

text
http://<host>/c/

The same portal is also served at:

text
http://<host>/stalker_portal/c/

The device then talks to the panel on /server/load.php, /stalker_portal/server/load.php or /portal.php. It identifies itself with its MAC address. The MAC address must belong to a MAG device entry in the panel.

7. Customer portal and web player

PageURL
Customer portalhttp://<host>/portal
Web playerhttp://<host>/webtv

Both addresses are printed by the installer and stored in CREDENTIALS.txt.

HTTPS

After ssl-setup.sh the same paths work on https://<domain>/..., because the HTTPS server block forwards every request to the HTTP block. Two limits apply:

  • The certificate covers one domain.
  • Stream URLs inside M3U playlists still start with http://. Port 80 or your custom port must stay open for players.

How to check it worked

Run these from any machine with a real line:

bash
curl -s "http://<host>/player_api.php?username=<user>&password=<pass>" | head -c 300; echo
curl -s "http://<host>/get.php?username=<user>&password=<pass>&type=m3u_plus&output=ts" | head -5
curl -s "http://<host>/xmltv.php?username=<user>&password=<pass>" | head -c 200; echo
curl -sI "http://<host>/live/<user>/<pass>/<stream-id>.ts" | head -3
curl -s -o /dev/null -w '%{http_code}\n' "http://<host>/c/"

Expected results: a JSON answer with the account data, a text that starts with #EXTM3U, an XML document, an HTTP status of 200 or 302, and 200 for the portal page.

If something goes wrong

AnswerMeaningAction
Invalid credentials (HTTP 401 on get.php, xmltv.php and enigma2.php)User name or password is missing or wrong.Check the line in the panel. Check for spaces in the URL.
Account expired (HTTP 401)The line has passed its expiry date.Extend the line.
Account disabled (HTTP 401)The line is disabled.Enable the line.
Service temporarily unavailable (HTTP 403)The endpoint is switched off in the panel settings. Separate switches exist for the whole Xtream API, player_api.php, get.php, xmltv.php and panel_api.php.Switch the endpoint on in the panel settings.
{"error":"Too many requests"} (HTTP 429)The request limit for one IP address was reached.Wait and retry. Check for an app that reloads the playlist in a loop.
Valid token required (HTTP 403)The token setting for xmltv.php is on.Use the EPG URL with the token from the panel, or switch the setting off.
{"error":"license_invalid"} (HTTP 403)The panel license is invalid and the path is not one of those that stay available.See License.
HTTP 502nginx cannot reach the API.See item 5 of Troubleshooting.
No connection at allPort closed or wrong port in the URL.Check the HTTP port chosen at installation and the provider firewall.
The playlist loads but streams do not playThe stream is down, or the player cannot follow the redirect to a load balancer, or the load balancer port is closed.Test the direct URL with curl -sI. See items 9 and 10 of Troubleshooting.
A MAG device stays on the loading screenThe MAC address is not registered, or the portal URL is wrong.Register the MAC in the panel. Use the form http://<host>/c/.

Back to documentation