6.8 KiB
Stream Object
Used as a response for defineStreamHandler
One of the following must be passed to point to the stream itself
url- string, direct http(s)/ftp(s)/rtmp link to a video stream (protocol support can vary depending on client app capabilities)ytId- string, youtube video ID, plays using the built-in YouTube playerinfoHash- string, info hash of a torrent file, andfileIdxis the index of the video file within the torrent; if fileIdx is not specified, the largest file in the torrent will be selectedfileIdx- number, the index of the video file within the torrent (frominfoHash), nzb (fromnzbUrl), rar (fromrarUrls, zip (fromzipUrls), 7zip (from7zipUrls), tgz (fromtgzUrls), tar (fromtarUrls)); (for torrents if fileIdx is not specified, the largest file will be selected)fileMustInclude- string, a string representing a regex (example"/.mkv$|.mp4$|.avi$|.ts$/i") to match the video file within the nzb (fromnzbUrl), rar (fromrarUrls, zip (fromzipUrls), 7zip (from7zipUrls), tgz (fromtgzUrls), tar (fromtarUrls)); (not supported for torrents yet)nzbUrl- string, http(s) or ftp(s) link to a NZB (usenet) file (this source will also unpack any known archive files), also see:Source Limitationsservers- array, a list of strings that each represent a connection to a NNTP (usenet) server (fornzbUrl) in the form ofnntp(s)://{user}:{pass}@{nntpDomain}:{nntpPort}/{nntpConnections}(nntps= SSL;nntp= no encryption) (example:nntps://myuser:mypass@news.example.com:563/4)rarUrls- array, a list ofSource Objectsthat lead to rar files (multi-volume supported), also see:Source LimitationszipUrls- array, a list ofSource Objectsthat lead to zip files (multi-volume supported), also see:Source Limitations7zipUrls- array, a list ofSource Objectsthat lead to 7z files (multi-volume supported), also see:Source LimitationstgzUrls- array, a list ofSource Objectsthat lead to tgz files (multi-volume supported), also see:Source LimitationstarUrls- array, a list ofSource Objectsthat lead to tar files (TAR does not support multi-volume), also see:Source LimitationsexternalUrl- string,Meta Linkor an external URL to the video, which should be opened in a browser (webpage), e.g. link to Netflix
Additional properties to provide information / behaviour flags
-
name- optional - string, name of the stream; usually used for stream quality -
title- optional - string, description of the stream (warning: this will soon be deprecated in favor ofstream.description) -
description- optional - string, description of the stream (previouslystream.title) -
subtitles- optional - array ofSubtitle objectsrepresenting subtitles for this stream -
sources- optional - array of strings, represents a list of torrent tracker URLs and DHT network nodes. This attribute can be used to provide additional peer discovery options wheninfoHashis also specified, but it is not required. If used, each element can be a tracker URL (tracker:<protocol>://<host>:<port>) where<protocol>can be eitherhttporudp. A DHT node (dht:<node_id/info_hash>) can also be included.WARNING: Use of DHT may be prohibited by some private trackers as it exposes torrent activity to a broader network, potentially finding more peers.
-
behaviorHints(all are optional)countryWhitelist: which hints it's restricted to particular countries - array of ISO 3166-1 alpha-3 country codes in lowercase in which the stream is accessiblenotWebReady: applies if the protocol of the url is http(s); needs to be set totrueif the URL does not support https or is not an MP4 filebingeGroup: if defined, addons with the samebehaviorHints.bingeGroupwill be chosen automatically for binge watching; this should be something that identifies the stream's nature within your addon: for example, if your addon is called "gobsAddon", and the stream is 720p, the bingeGroup should be "gobsAddon-720p"; if the next episode has a stream with the samebingeGroup, stremio should select that stream implicitlyproxyHeaders: only applies tourls; When using this property, you must also setstream.behaviorHints.notWebReady: true; This is an object containingrequestandresponsewhich include the headers that should be used for the stream (example value:{ "request": { "User-Agent": "Stremio" } })videoHash: - string, the calculated OpenSubtitles hash of the video, this will be used when the streaming server is not connected (so the hash cannot be calculated locally), this value is passed to subtitle addons to identify correct subtitlesvideoSize: - number, size of the video file in bytes, this value is passed to the subtitle addons to identify correct subtitlesfilename: - string, filename of the video file, although optional, it is highly recommended to set it when usingstream.url(when possible) in order to identify correct subtitles (addon sdk will show a warning if it is not set in this case), this value is passed to the subtitle addons to identify correct subtitles
Source Objects
An object representing a streaming source, supports the following properties:
url- required - string, direct http(s)/ftp(s) link to a file (depending on context: zip, rar, 7z, tar, tgz)bytes- optional - integer, size of the file in bytes - while optional adding this can speed up the initial buffering
Source Limitations
- nzb: will also unpack all known archive types, a nzb files cannot be streamed unless both the first and last segment of the video file are retrievable, PAR2 recovery is not supported
- rar: multi-volume and seeking in the video supported, decompression is not supported (decompression is not normally required for audio / video files)
- zip: multi-volume and decompression are supported, it does not support seeking in the video
- 7zip: multi-volume and LZMA decompression are support, it supports seeking only when compression is not used (decompression is not normally required for audio / video files)
- tar: does not support multi-volume and decompression by design (tar only merges multiple files into one without compressing), seeking is supported
- tgz: multi-volume and decompression are supported, it does not support seeking in the video