{
  "api": "scenaAPI",
  "author": "hiamjaden",
  "github": "https://github.com/hiamjaden",
  "version": "1.0.0",
  "status": "online",
  "build": "042a54a94d8a94f38dd32efdf14d056746ba8e02",
  "notes": [
    "every url returned by this api is a signed /proxy, /sub or /dl link on this host",
    "sources, qualities and subtitles are verified end to end before they are returned",
    "raw cdn links are never exposed",
    "download.status is ready when we confirmed the link, unverified when the source catalog offered it but our check could not confirm it in time, unavailable when nothing was offered",
    "download.all holds confirmed links, download.unconfirmed holds the ones we could not confirm, download.pending counts them"
  ],
  "endpoints": {
    "movie": {
      "stream": "/movie/stream?id={tmdbId}",
      "download": "/movie/download?id={tmdbId}",
      "all": "/movie/all?id={tmdbId}"
    },
    "tv": {
      "stream": "/tv/stream?id={tmdbId}&season={season}&episode={episode}",
      "download": "/tv/download?id={tmdbId}&season={season}&episode={episode}",
      "all": "/tv/all?id={tmdbId}&season={season}&episode={episode}"
    },
    "player": {
      "movie": "/embed/movie/{tmdbId}",
      "tv": "/embed/tv/{tmdbId}/{season}/{episode}",
      "options": "?autoplay=1&t={startSeconds}"
    },
    "relay": {
      "stream": "/proxy?u={signedUrl}&s={signature}",
      "download": "/dl?t={movie|tv}&id={tmdbId}&g={mp4|mkv}&q={quality}&f={filename}&s={signature}",
      "subtitle": "/sub?u={signedUrl}&s={signature}"
    }
  },
  "fields": {
    "stream": {
      "status": "ready when a source was verified end to end, unavailable when none was",
      "source_count": "how many sources answered with a usable playlist",
      "kind": "shape of the default source: master (adaptive), media (single rendition) or files",
      "playable": "signed relay url of the default source, ready for any hls player",
      "quality": "label of the best rendition of the default source",
      "quality_count": "how many renditions the default source offers",
      "qualities": "best rendition first, one object per rendition: id, label, url, resolution, width, height, bandwidth, segments, container, language, badge, default",
      "sources": "every verified source, best first: id, name, kind, quality_count, url, qualities; the name is ours, never the upstream one",
      "subtitles": "relayed tracks: label, url, served as webvtt from this host",
      "verified_at": "iso time of the check this answer comes from"
    },
    "download": {
      "status": "ready when our probe confirmed a link, unverified when a link was offered but could not be confirmed in time, unavailable when nothing was offered",
      "links": "count of confirmed links in all",
      "pending": "count of unconfirmed links",
      "all": "confirmed links, mp4 before mkv",
      "mp4": "the confirmed links whose bytes are really mp4, present only when there are any",
      "mkv": "the confirmed links whose bytes are really matroska, present only when there are any",
      "unconfirmed": "links the catalog offered that our probe could not confirm; each one carries verified false and checked with the reason",
      "note": "plain sentence about the unconfirmed list",
      "verified_at": "iso time of the check this answer comes from"
    },
    "link": {
      "id": "stable id inside one answer",
      "group": "mp4 or mkv, the container the bytes really are",
      "container": "extension of the relayed file",
      "filename": "name the relay sends as save-as",
      "url": "signed relay url on this host, valid until the expiry inside it",
      "quality": "verified label such as 1080p, present only when the source or the probe said so",
      "size": "human size, present only when the source reported one",
      "size_bytes": "exact size in bytes, present only when the source reported one",
      "language": "language tag, present only when the source reported one",
      "verified_at": "iso time this link passed the probe"
    },
    "embed": {
      "events": "the player posts {source:\"scena-player\", type, mediaKey, ...} to the parent frame",
      "types": "ready, metadata, started, timeupdate, state, play, pause, ended, seek, seeked, buffering, loadedmetadata, resumed, refreshed, qualitychange, sourcechange, subtitlechange, volumechange, ratechange, fullscreenchange, visibilitychange, dispose, error",
      "ready": "{duration, sourceInfo:{index, name, qualities}, levels:[{index, height, width, bitrate}], subtitles}",
      "timeupdate": "{currentTime, duration, percent, buffered, bufferedPercent, bufferHealth, quality, sourceInfo}",
      "state": "{ready, type, tmdbId, title, paused, ended, muted, volume, rate, currentTime, duration, buffered, bufferHealth, quality, qualityMode, source, subtitle, levels}",
      "commands": "post {source:\"scena-parent\", action} to the frame: play, pause, toggle, seek (+time), seekBy (+time), setVolume (+volume), setMuted (+muted), setRate (+rate), setQuality (+height), setSource (+index), setSubtitle (+index), next, refresh, getState, toggleFullscreen"
    }
  }
}