PlayerStream
EN
Ko-fi

Guides / Create an addon

Addon · publishing

Publishing your addon.

From your PC to any device: an https address, permission for the web version (CORS) and a few checks. The same goes for your TV lists and guides.

You're responsible for what you publish. Whoever creates an addon is responsible for what it offers, and whoever adds it to the app, for what they add. Only publish content you have the right to share and follow the terms of the site where you host it.

01

Testing it at home.

  • Start your addon on the PC (for example, the example addon) and open http://127.0.0.1:8840/manifest.json in its browser.
  • On a phone or TV, use the PC's IP on your network (http://192.168.1.20:8840/manifest.json, for example): 127.0.0.1 is the device itself. Allow that port through the PC's firewall.
  • The Android and Windows apps accept http addresses on your network. The web version doesn't: a browser can't reach home addresses.
02

An https address.

For anyone to use it from anywhere, publish it over https with a normal certificate (self-signed ones don't work).

  • An addon that runs a program: on a server or an app hosting service, behind https.
  • A file-based addon (below) or an M3U list: on any static site hosting with https.
  • If you move the addon, leave a permanent redirect (301 or 308): the app updates the saved address on its own. It never goes from https to http, or from the internet to your home network.
  • Videos don't go through your addon: they also need to be somewhere that allows range requests (Range).
03

The web version: CORS.

The web version of the app (in the browser) requests your addon from the page itself. The browser only lets it read the response if your server allows it with this header:

response header
Access-Control-Allow-Origin: *
The apps request the addon directly; the web version goes direct if there's https and CORS, and otherwise through the PlayerStream gateway Android · Windows http or https Web version in the browser Your addon manifest.json gateway PlayerStream direct https + CORS: direct otherwise: GET
The gateway only does GET or HEAD on your JSON; videos never go through it.
  • If CORS is missing, or your addon is http, the web version requests it through the PlayerStream gateway. It works, but it's better not to depend on it: set up https and CORS.
  • TV lists and guides and videos don't go through the gateway: in the web version they need https and CORS, no exceptions, and the browser doesn't allow headers such as User-Agent or Referer.
  • Many static site hosts already send that header. Check it below.
04

An addon with files only.

No program: a few JSON files on any hosting with https. The app requests …/manifest.json, …/catalog/movie/open-movies.json and …/stream/movie/tt1727587.json, which are exactly these files:

the files
mi-addon/
├── manifest.json
├── catalog/
│   └── movie/
│       └── open-movies.json
└── stream/
    └── movie/
        ├── tt1727587.json
        ├── tt1254207.json
        └── tt2285752.json
manifest.json
{
  "id": "org.example.open-movies-static",
  "version": "1.0.0",
  "name": "Open Movies (static example)",
  "resources": ["catalog", "stream"],
  "types": ["movie"],
  "idPrefixes": ["tt"],
  "catalogs": [{ "type": "movie", "id": "open-movies", "name": "Open movies" }]
}
stream/movie/tt1727587.json
{
  "streams": [
    {
      "name": "Open Movies",
      "title": "Sintel (2010) · Blender Foundation · CC BY 3.0",
      "url": "https://download.blender.org/durian/movies/Sintel.2010.1080p.mkv"
    }
  ]
}
  • With "idPrefixes": ["tt"], the app requests links with the IMDb id: file names that work on any system.
  • The catalog is the one from the catalog guide. When the app requests the next page (…/open-movies/skip=3.json), the host will reply 404: for the app, that's the end.
  • A title without a link file returns 404: the app takes it that there are none.
05

Checking it.

From a terminal (on Windows, curl.exe works too):

terminal
curl -i https://tu-sitio.example/manifest.json
curl -i https://tu-sitio.example/stream/movie/tt1727587.json
curl -I -H "Range: bytes=0-0" https://download.blender.org/durian/movies/Sintel.2010.1080p.mkv
  • The JSON files: 200, Content-Type: application/json and Access-Control-Allow-Origin: *.
  • The video: 206 Partial Content (or 200), and not text/html.
  • Make sure they reply quickly: the app waits 8 seconds to connect and 20 for the response (30 for the manifest).
06

Sharing it.

  • The simplest way: your manifest.json address. It's pasted into Settings → Content → Addons → “Address, JSON or line”.
  • In the app, each addon's “Copy” button copies a code to paste on another device or send to someone.
  • With an account, the addon list travels encrypted with the account key to all its devices: you add it once.
  • State on your page what content you offer, under what license and, if you collect any data, your privacy notice.