Docs / Source types

Source types

A source is what a code hands to the player. Each code has one source at a time, of one of three types. You can switch a code to another type later, and its digits stay the same.

Xtream Codes

The most common setup for IPTV panels. Enter the details your panel gives the customer:

Server URL
With the scheme and port, for example http://line.example.com:8080.
Username
The line's username.
Password
The line's password. It is stored encrypted and never shown again. When you edit the source, leave it blank to keep it.

Testing the connection

Test connection signs in to the server from ours with those details. When it works, it shows how many live channels, movies and series the line has, and the account's expiry date when the server reports one. When it fails, the message says why:

  • We could not reach this server from ours. The address or port is wrong, the server is down, or it blocks traffic from data centres.
  • The server rejected this username and password. The server answered but refused the login.
  • The server answered, but not like an Xtream panel. Usually the wrong port, or a web page's address.
  • The login works, but the account status is "…". The line is expired, banned or disabled on the provider's panel.

The test is a check, not a requirement: you can save a source that fails it, for example when the server only accepts your customers' networks. You can test again from the code's Source tab at any time.

M3U playlist

Give a link to the playlist, or upload the file.

Playlist URL
An http or https link to an .m3u or .m3u8 playlist.
Upload .m3u
A playlist file of up to 35 MB. Smart Code stores it encrypted and gives Mega Player a private link to it. To change channels, upload a new file; the code stays the same.
EPG URL
Optional. An XMLTV guide, plain or .gz.

An uploaded file must start with #EXTM3U and have at least one #EXTINF entry. Players show your channels in groups only if the file has group-title attributes, and logos and guide data only with tvg-logo and tvg-id.

If your playlist was exported from an Xtream Codes line (its links look like http://server:port/username/password/…), add the line as an Xtream source instead. The player then gets categories, logos and the guide from the server, and a password change is one field instead of a new file.

For a playlist URL, Test connection downloads the playlist and counts its channels. With an EPG link, it also reports how many channels the guide covers. Playlists often carry a username and password in the link, so the full link is treated as secret, like an Xtream password.

Mega JSON

One file with live channels, movies and series, for providers who don't run an Xtream panel. There are three ways to add it:

  • Paste or upload a file of up to 10 MB. It is checked line by line before it is saved, and Smart Code hosts it.
  • Live URL (Pro and Business): give a link and Smart Code fetches it on a schedule. The link is checked as soon as you enter it. The feed can be in the Smart Code format, or a JSON list of channels that Smart Code reads automatically. See Live-URL mapping.

The fields are described in Mega JSON format.

Revisions

Saving a source never overwrites it: each save becomes a new revision, and the code's History tab lists them. Choosing Restore on an old revision saves it again as the newest one. On the trial, History shows the last 3 revisions; paid plans show all of them.

How quickly changes reach viewers

Straight away, the next time a player looks the code up. Saving a source, pausing a code or revoking a device clears Smart Code's copy of the code at once. A player that is already playing keeps its current streams until it reloads the playlist or is restarted.

Live-URL JSON feeds are fetched again every 2 minutes, so a change in your feed takes up to 2 minutes to show.

Addresses we won't use

For safety, sources must point to a public internet address. Links to localhost, private networks (such as 192.168.x.x or 10.x.x.x) and similar addresses are refused, even when a public name points to one of them.

NextMega JSON format →