Rust version of the stremio-addon-sdk using stremio-core
This is an unofficial SDK for building stremio addons. If you're totally new to addon building, it's recommended to start reading the offical stremio addon SDK docs to get a basic understanding of how addons work. This SDK is meant to step up your game if you want to make use of Rust's powerfull type system and performance.
Warning
This project is in low-maintenance mode. I will still accept PRs but likely won't contribute much to the project myself.
use stremio_addon_sdk::builder::Builder;
use stremio_addon_sdk::server::{serve_http, ServerOptions};
#[tokio::main]
async fn main() {
// create manifest file using stremio-core's Manifest struct
let manifest = Manifest {
// ...
};
// build addon interface
let interface = Builder::new(manifest)
// function as parameter
.define_catalog_handler(handle_catalog)
.define_stream_handler(handle_stream)
// closure as parameter
.define_meta_handler(|resource: &ResourceRef| -> EnvFuture<ResourceResponse> {
let response = ResourceResponse::Metas { metas: vec![] };
return Box::new(future::ok(response));
})
.build();
// run HTTP server with default settings
serve_http(interface, ServerOptions::default());
}
See the example-addon for more details or take a look at the documentation.
- How do I host my addon?
- Why would I use this over the official SDK?
- You tell me. Types, speed & stremio-core are my reasons ;)
- How do I publish my addon?
- Use this website to publish your addon to the public Stremio addon collection.
Documentation can be found here.