Skip to main content

Overview

Resource types represent content metadata, videos, streams, and subtitles returned by Stremio addons.

MetaItem

Detailed metadata item with full video information.
preview
MetaItemPreview
required
Preview information (flattened into parent)
videos
Vec<Video>
default:"[]"
List of videos associated with this meta item (sorted and deduplicated)

Methods

videos_iter(&self) -> impl DoubleEndedIterator<Item = &Video>

Iterate over videos, filtering out specials (season 0) for series.

videos_by_season(&self, season: u32) -> Vec<&Video>

Get all videos for a specific season.

MetaItemPreview

Preview metadata without full video list (used in catalogs).
id
String
required
Unique identifier
type
String
required
Content type (e.g., “movie”, “series”, “channel”)
name
String
required
Display name
poster
Option<Url>
Poster image URL
background
Option<Url>
Background image URL
Logo image URL
description
Option<String>
Description text
releaseInfo
Option<String>
Release information (e.g., year)
runtime
Option<String>
Runtime information
released
Option<DateTime<Utc>>
Release date
posterShape
PosterShape
default:"Poster"
Shape of the poster (Square, Landscape, or Poster)
Related links (IMDb, genres, etc.)
trailerStreams
Vec<Stream>
default:"[]"
Trailer streams
behaviorHints
MetaItemBehaviorHints
default:"{}"
Behavior hints

Video

Represents a single video (episode, movie, etc.).
id
String
required
Unique identifier
title
String
default:""
Video title (also accepts “name” alias)
released
Option<DateTime<Utc>>
Release date
overview
Option<String>
Video description
thumbnail
Option<String>
Thumbnail image URL
streams
Vec<Stream>
default:"[]"
Available streams (also accepts “stream” alias for single stream)
seriesInfo
Option<SeriesInfo>
Series information if this is an episode (flattened)
trailerStreams
Vec<Stream>
default:"[]"
Trailer streams

Methods

stream(&self) -> Option<Cow<'_, Stream>>

Get the single stream if exactly one exists, or construct YouTube stream from video ID.

SeriesInfo

Series episode information.
season
u32
required
Season number (0 for specials)
episode
u32
required
Episode number

Stream

Stream source and metadata.
source
StreamSource
required
Stream source (flattened)
name
Option<String>
Stream name/quality indicator
description
Option<String>
Stream description (also accepts “title” alias)
thumbnail
Option<String>
Stream thumbnail
subtitles
Vec<Subtitles>
default:"[]"
Embedded subtitles
behaviorHints
StreamBehaviorHints
default:"{}"
Behavior hints

Methods

encode(&self) -> Result<String, anyhow::Error>

Encode stream to base64 string.

decode(stream: &str) -> Result<Self, anyhow::Error>

Decode stream from base64 string.

youtube(video_id: &str) -> Option<Self>

Construct YouTube stream from video ID.

is_source_match(&self, other_stream: &Stream) -> bool

Check if two streams have the same source.

is_binge_match(&self, other_stream: &Stream) -> bool

Check if two streams have the same binge group.

convert(&self, streaming_server_url: Option<&Url>) -> Result<Stream<ConvertedStreamSource>, EnvError>

Convert stream source to use streaming server for archives, torrents, etc.

StreamSource

Enum defining various stream sources.

Url

url
Url
required
Direct URL to video file

YouTube

ytId
String
required
YouTube video ID

Rar

rarUrls
Vec<ArchiveUrl>
required
RAR archive URLs
fileIdx
Option<u16>
File index within archive
fileMustInclude
Vec<String>
default:"[]"
Filename patterns that must match

Zip

zipUrls
Vec<ArchiveUrl>
required
ZIP archive URLs
fileIdx
Option<u16>
File index within archive
fileMustInclude
Vec<String>
default:"[]"
Filename patterns that must match

Zip7

7zipUrls
Vec<ArchiveUrl>
required
7-Zip archive URLs
fileIdx
Option<u16>
File index within archive
fileMustInclude
Vec<String>
default:"[]"
Filename patterns that must match

Tgz

tgzUrls
Vec<ArchiveUrl>
required
TGZ archive URLs
fileIdx
Option<u16>
File index within archive
fileMustInclude
Vec<String>
default:"[]"
Filename patterns that must match

Tar

tarUrls
Vec<ArchiveUrl>
required
TAR archive URLs
fileIdx
Option<u16>
File index within archive
fileMustInclude
Vec<String>
default:"[]"
Filename patterns that must match

Nzb

nzbUrl
Url
required
NZB file URL
servers
Vec<Url>
default:"[]"
Usenet server URLs

Torrent

infoHash
[u8; 20]
required
BitTorrent info hash (hex encoded)
fileIdx
Option<u16>
File index within torrent
announce
Vec<String>
default:"[]"
Tracker announce URLs (also accepts “sources” alias)
fileMustInclude
Vec<String>
default:"[]"
Filename patterns that must match

PlayerFrame

playerFrameUrl
Url
required
URL to embed in player frame

External

externalUrl
Option<Url>
External URL for general platforms
androidTvUrl
Option<Url>
Android TV specific URL
tizenUrl
Option<String>
Samsung Tizen URL
webosUrl
Option<String>
LG webOS URL

ArchiveUrl

URL for archive file with optional size.
url
Url
required
Archive URL
bytes
Option<u64>
File size in bytes
Serializes as [url] or [url, bytes].

StreamBehaviorHints

Hints for stream handling.
notWebReady
bool
default:"false"
Stream is not ready for web playback
bingeGroup
Option<String>
Group ID for binge watching
countryWhitelist
Option<Vec<String>>
Allowed country codes
proxyHeaders
Option<StreamProxyHeaders>
Headers for proxied requests
filename
Option<String>
Suggested filename
videoHash
Option<String>
Video content hash
videoSize
Option<u64>
Video file size in bytes
other
HashMap<String, serde_json::Value>
default:"{}"
Additional custom hints

Subtitles

Subtitle track information.
id
String
required
Subtitle track identifier
lang
String
required
Language code
url
Url
required
Subtitle file URL
External link for metadata.
name
String
required
Link display name
category
String
required
Link category (e.g., “imdb”, “Genres”)
url
Url
required
Link URL

MetaItemBehaviorHints

Behavior hints for meta items.
defaultVideoId
Option<String>
Default video to play
Featured video ID
hasScheduledVideos
bool
default:"false"
Whether videos are scheduled
other
HashMap<String, serde_json::Value>
default:"{}"
Additional custom hints

PosterShape

Enum for poster aspect ratios:
  • Square: 1:1 square ratio
  • Landscape: Wide horizontal format
  • Poster: Standard vertical poster (default)

Build docs developers (and LLMs) love