Skip to content

Stremio addon SDK using rust, stremio-core and hyper

Notifications You must be signed in to change notification settings

sleeyax/stremio-addon-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stremio Addon SDK

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.

Getting started

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.

FAQ

  • 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

Documentation can be found here.

Related projects

If you're a gopher, check out the Stremio addon SDK for Go (caution: this project seems to be no longer maintained).