The add-ons in Stremio are the most fundamental part of the app. They provide the content that the users enjoy.
An add-on in Stremio, unlike other similar apps, doesn't generally run on а client's computer (however, there are exceptions). Instead, it is hosted on the Internet just like any website. This brings ease of use and security benefits to the end user.
If an add-on is served via HTTP, CORS headers must be present.
The add-on philosophy
- Add-ons are not meant to compete with VOD services; they’re meant to integrate existing VOD services into Stremio.
- Add-ons are not meant to be used in the same way as YouTube; you don’t upload your content to a Stremio add-on.
The add-on must adhere to the add-on API. The most important part is the manifest.
The add-on manifest is a JSON object describing the add-on's capabilities.
Every add-on provides one or more resources for media content. The resources are organized in a tree-like structure. In the root of this tree, we have catalogs. The catalogs provide media collections of different types. For each type there are meta items. These items contain videos. Finally, for every video there are one or more streams. There is an option where the meta item does not contain videos. In this case it provides streams directly.
The complete tree should look like that:
Catalog +-- Type +-- Meta Item +-- Videos +---+-- Streams
For Stremio to be able to display any data, it must first find it. For this purpose in every add-on's manifest, one or more resources must be declared.
The resources are basically a segmented way to build the content tree we mentioned. Every resource is accessed at a certain endpoint where your add-on should respond with proper data.
|manifest||The add-on description and capabilities.|
|catalogs||Summarized collection of meta items. Catalogs are displayed on the Srtemio Board. You can also browse the catalogs in the Discover.|
|metadata||Detailed description of a meta item. This description is displayed when the user selects an item form the catalog.|
|streams||Tells Stremio how to obtain the media content. It may be torrent info hash, HTTP URL, etc.|
|subtitles||Subtitles resource for the chosen media.|
All the resources in an add-on can be dynamically generated by a script or just by plain text JSON files located on your file system. Our goal is to introduce you to the Stremio's way of using add-ons rather than fighting with a framework/language. We will use static files. The file system will be used as a router. This approach can also be used in add-on written in PHP or CGI for example.
You are free to use whatever suits your needs in your implementation, .
At this point you should be familiar with Stremio's media structure, how add-ons work, and their basic endpoints.
Feel free to proceed to the next chapter and start the guide.