PlayerStream
EN
Ko-fi

Guides / Live TV

Servers

Xtream Codes and Stalker.

For those who offer their own channels with one of these two systems: what details the app asks for, what requests it makes and what it expects from each response.

Legal services only. PlayerStream does not include, sell or recommend any TV service. Whoever adds something is responsible for it, and whoever runs a server, for what it offers: only channels one has the right to provide or watch. The username, password and MAC are stored encrypted with each person's account.

01

Xtream Codes.

In Settings → Content → Live TV → “Xtream Codes”: “Name (optional)”, “Server” (for example, http://server:8080; without a scheme, http:// is added), “Username”, “Password” and “Format” (MPEG-TS or HLS). You can also paste the whole get.php?username=…&password=… link: the app takes the username and password from it.

Live TV only: no movies (VOD) or series from the server.

The “Add Xtream Codes” dialog with Name, Server, Username, Password and Format (MPEG-TS or HLS), empty
“Add Xtream Codes” (empty: no real server).
AndroidAndroid TVWindowsWeb version

In the web version, only https servers with CORS.

02

What the app requests.

RequestWhat it uses from the response
player_api.php?username=U&password=Puser_info.auth (1), status (“Active”), exp_date, max_connections, message and server_info.timezone.
…&action=get_live_categoriescategory_id and category_name.
…&action=get_live_streamsstream_id, name, category_id, stream_icon, epg_channel_id, num, tv_archive and tv_archive_duration. Only those with stream_type live, created_live or radio_streams.
xmltv.php?username=U&password=PIts XMLTV guide (if it fails, it carries on without it).
…&action=get_short_epg&stream_id=ID&limit=4Only for the channel being watched, if it has no guide: title and description in base64, start_timestamp and stop_timestamp.
/live/U/P/ID.ts or .m3u8The stream, in the chosen format.
/timeshift/U/P/minutos/AAAA-MM-DD:HH-MM/ID.tsCatch-up (Lite+), if tv_archive is 1 (for tv_archive_duration days, in the server_info.timezone time zone).
player_api.php (minimal response)
{
  "user_info": { "auth": 1, "status": "Active", "exp_date": "1798761600", "max_connections": "1" },
  "server_info": { "timezone": "Europe/Madrid" }
}
action=get_live_streams
[
  { "stream_id": 101, "num": 1, "name": "Northwind One", "stream_type": "live",
    "category_id": "1", "stream_icon": "https://tu-sitio.example/tv/logos/1.png",
    "epg_channel_id": "one.northwind.example", "tv_archive": 0, "tv_archive_duration": 0 }
]

The server's guide takes priority for its channels; epg_channel_id is their id in it. The get_vod_* and get_series* routes are not used.

03

Stalker portal.

In Settings → Content → Live TV → “Stalker portal”: “Name (optional)”, “Portal address” (for example, http://portal:8080/c/) and “MAC” (12 hex characters, with or without separators). It doesn't ask for a serial number, device id, signature or username and password. Live TV only.

The “Add a Stalker portal” dialog with Name, Portal address and MAC, empty
“Add a Stalker portal” (empty).
AndroidAndroid TVWindowsWeb version
04

What the app requests.

The address: if it ends in .php, that one. If it ends in /stalker_portal, …/server/load.php. Otherwise, it tries /portal.php, /server/load.php and /stalker_portal/server/load.php in order, and keeps the first one that returns its token.

Request (with &JsHttpRequest=1-xml)What for
type=stb&action=handshakeThe token.
type=stb&action=get_profileChecks access (blocked = 1 or status = "1": blocked).
type=itv&action=get_genresThe groups: id and title.
type=itv&action=get_all_channelsjs.data[]: id, name, cmd, tv_genre_id, logo (if it's http), number and xmltv_id.
type=itv&action=create_link&cmd=…The channel's address, when it's played (any prefix such as “ffmpeg ” is stripped).
type=itv&action=get_short_epg&ch_id=…What's on: name, descr, start_timestamp, stop_timestamp.

Headers: a MAG200's User-Agent, X-User-Agent: Model: MAG250; Link: WiFi, the cookie mac=…; stb_lang=en; timezone=… and Authorization: Bearer <token>. If the channel has an xmltv_id, it's also matched against your XMLTV guides.

05

Common errors.

The app saysWhat's wrong
“Wrong username or password.”user_info.auth is not 1.
“The account is not active (…).”status is not “Active”.
“The server does not reply like an Xtream Codes server.”player_api.php doesn't return the expected JSON.
“The MAC is not valid (00:1A:79:…).”It's not 12 hex characters.
“It is not a Stalker portal (it gives no token).”None of the addresses tried answers the handshake.
“The portal does not allow access to this MAC (…).”The MAC is blocked or not registered.
“The portal does not give the address of this channel.”create_link returns no address.

In an Xtream's box, “The account expires on …” (from exp_date) and the “TS” and “HLS” buttons to switch format.