Skip to content
Alexandru Branza edited this page Aug 25, 2020 · 12 revisions

Official documentation for the Powder Web API.

Jump to Topic


Introduction

In order to use the Powder Web API, you need an access key, there are 2 types of access keys:

  • user access key
  • master key

The most common way of using the API is with a user access key, which is gotten by authenticating to the API with the user's email and password. The reason this is required is because user access keys are generated during the authentication process and have an expiration time.

For all API calls (except the authorisation call) the user access key or master key need to be added as the authorization request header.

All API calls are GET http requests made to the /actions endpoint, and all include a method parameter.

The difference between a user access key and a master key is the power you will have with the API. Both access key types support starting downloads, playback and changing settings, but the master key will give access to administrator only settings.

The master key cannot be gotten through authentication, a master key is generated on app start and changes every time you start Powder Web, as it is meant to be used only locally to change advanced settings, not for the use with the API. The master key is printed in the terminal window that you started Powder Web from, and is only visible if you started Powder Web through a terminal.

Authentication

Request

To authenticate you need to create a GET request in the form to:

/actions?method=login&value=%7B%22email%22%3A%22test%40test.com%22%2C%22password%22%3A%22test%22%7D
  • The method parameter must be login for this call.

  • The value parameter must be a URL encoded JSON string in the form of: { "email": "...", "password": "..." }

Response

The API will respond with a JSON string in the form of:

{
  "token": "fe4a644605bf5e3da9c12a2696645669",
  "expiresOn": 1595781786600
}

From this response, the token is the user access key, which you will need to set as the authorization header for all future API calls, and the expiresOn value is the unix timestamp (in milliseconds) of the expiration moment of the user access key.

Getting User Settings

Request

To get the user settings, you can make a request in the form of:

/actions?method=setting&for=getAll

Response

The response will be a JSON string in the form of:

{
  "embedToken": "8235bd682c1c5b33b682cb0512a2412a",
  "subLangs": "all",
  "subLimit": 3,
  ...
}

List Available Streams

To get the list of available streams, there are 2 different endpoints:

  • Torrent list:
/actions?method=getall
  • Youtube-DL links, Ace Stream links, SopCast links, Local Media, etc:
/actions?method=getallextra

The response from these API requests will be a JSON string containing an object with items.

Embedding in Websites

To embed in websites, you will first need an embed key, you can get the embed key from the [getting user settings(https://github.com/jaruba/PowderWeb/wiki/API#getting-user-settings) API response.

For further information on embedding in websites, refer to the documentation for the embedding feature.

Transcoding Streams

If you require streams that are transcoded for Web Browsers, then it is highly recommended that you use the embedding feature. Embedding has many advantages as it will also identify the user's browser and transcode the video accordingly for that particular browser.

If, however, you require the transcoding engine to make the videos work in a particular scenario, and you know what you are doing, then you can make requests in the form of:

/web/08ada5a7a6183aae1e09d831df6748d566095a10/0/360p.mp4?token=fe4a644605bf5e3da9c12a2696645669&maxHeight=404&maxWidth=720&needsAudio=0&needsVideo=0&a=aac&v=h264&forAudio=-1&copyts=-1&forceTranscode=-1&useMatroska=1&audioDelay=0&start=0

This request will return a transcoded video directly.

Breakdown of the URL request:

/web/${infoHash}/${fileIdx}/${videoQuality}.mp4?token=${userAccessToken}&maxHeight=${maximumVideoHeight}&maxWidth=${maximumVideoWith}&needsAudio=${requiresAudioTranscoded}&needsVideo=${requiresVideoTranscoded}&a=${audioCodec}&v=${videoCodec}&forAudio=${audioTrack}&copyts=${copyTimestamp}&forceTranscode=${forceTranscoding}&useMatroska=${shouldUseMatroska}&audioDelay=${audioDelay}&start=${startTime}&isYtdl=${isYoutubeDlLink}&isLocal=${isLocalFile}
  • ${infoHash}: the infoHash received from the starting downloads or list available stream API requests
  • ${fileIdx}: the file index of the video in the torrent (starts from 0), see getting torrent data for more information, (if the file is not a torrent, then always set this to 0)
  • ${videoQuality}: the video quality to transcode to, can be 360p, 480p, 720p, 1080p, etc.
  • ${userAccessToken}: the user access token that is normally set as the authorization header.
  • ${maximumVideoHeight}: the maximum height (in pixels) that the transcoded video should have
  • ${maximumVideoWith}: the maximum width (in pixels) that the transcoded video should have
  • ${requiresAudioTranscoded}: if the audio stream should also be transcoded for the file, can be 0 or 1
  • ${requiresVideoTranscoded}: if the video stream should also be transcoded for the file, can be 0 or 1
  • ${audioCodec}: what audio codec to transcode to
  • ${videoCodec}: what video codec to transcode to
  • ${audioTrack}: what audio stream to include in the transcoded version (a video can have multiple audio tracks), starts from -1 (not set by user)
  • ${copyTimestamp}: if the timestamp should be copied to the transcoded video
  • ${forceTranscoding}: if it should transcode regardless of the other settings (such as ${requiresAudioTranscoded} or ${requiresVideoTranscoded}), starts from -1 (not set by user)
  • ${shouldUseMatroska}: if the Matroska video codec should be used for transcoding
  • ${audioDelay}: the audio delay, can be negative also, set in seconds
  • ${startAt}: start the stream from a specific time, in seconds, set as float
  • ${isYoutubeDlLink}: if the stream is from a youtube-dl link or not (can be 0 or 1)
  • ${isLocalFile}: if the stream is from a local media file (can be 0 or 1)

Using History

The history is saved automatically for each item that is player with the web player. You can interact with the history through the API by getting the list of history items and by setting the history items.

Getting History

Request

You can get the entire list of history items with this request:

/actions?method=historyList

Response

The response will be a JSON string containing an array in the form of:

[
  {
    "method": "updateHistory",
    "filename": "Lounge Beats   Deep Jazzy House - by DJ Dimsa",
    "time": "2.207079",
    "duration": "3693",
    "infohash": "httpswwwyoutubecomwatchvEYSo692Cl68",
    "fileID": "0",
    "ended": false,
    "isLocal": false,
    "isYtdl": "1",
    "utime": 1595238311646
  },
  ...
]

Setting History

Request

You can update the item in the history by using this request:

/actions?method=updateHistory&filename=Sintel.mp4&time=9.481249&duration=888&infohash=08ada5a7a6183aae1e09d831df6748d566095a10&fileID=5&ended=false&isLocal=undefined&isYtdl=undefined

Breakdown of the request:

/actions?method=updateHistory&filename=${filename}&time=${time}&duration=${duration}&infohash=${infoHash}&fileID=${fileIdx}&ended=${hasEnded}&isLocal=${isLocal}&isYtdl=${isYtdl}
  • ${filename}: the filename of the video file, where a filename is not available, then a video title can be used as the value
  • ${time}: the current playback time to save the history with, in seconds, set as float
  • ${duration}: total duration of the video, in seconds
  • ${infoHash}: the infohash of the torrent, where a torrent infohash is not available, a pid for the video can be used as the value
  • ${fileIdx}: the file id of the torrent, starts from 0, see getting torrent data for more information (if the file is not from a torrent, then always set this to 0)
  • ${hasEnded}: if the video has ended playback, boolean, can be true or false
  • ${isLocal}: if the video is a local file, set to 1 if it is a local video, any other value is considered false
  • ${isYoutubeDl}: if the video is a Youtube-DL link, set to 1 if it is a Youtube-DL link, any other value is considered false

Torrents

Torrents - Starting Downloads

Request

To start a new torrent download, use:

/actions?method=new&torrent=...
  • The method parameter must be new for this call.

  • The torrent parameter must be a URL encoded magnet link

Response

The API will respond with a JSON string in the form of:

{
  "opener": "...",
  "utime": 1595177980886,
  "infoHash": "08ada5a7a6183aae1e09d831df6748d566095a10",
  "name": "Sintel [H264 - Eng - Multisubs] [Tntvillage]",
  "totalSize": 0,
  "path": false,
  "peers": 0,
  "uploadedStart": 0,
  "uploadSpeed": 0,
  "uploaded": 0,
  "downloadSpeed": 0,
  "downloaded": 0
}

It is important to take note of the utime and infoHash values from this response, as you will use them later on to identify your newly started torrent and in order to stream the content from it.

Torrents - Ready to Stream

Request

To stream newly added torrents, you must first find when they are ready to be streamed, in order to do so, use this API call:

/actions?method=isListening&utime=1595177980886

Where utime is the value received from the starting downloads or list available streams API requests.

Response

The typical response will be a JSON string in the form of:

{
  "value": false
}

The value parameter is a boolean, and can be false or true, once this parameter returns true, the torrent is ready for streaming.

Torrents - Download Playlist

To download the playlist of a torrent, use this request:

/playlist.m3u?id=c4abdb6d30b1cdae74e1237868dc64d47dfcd714&token=fe4a644605bf5e3da9c12a2696645669

Where id is the infoHash received from the starting downloads or list available stream API requests and token is the user access token that is normally set as the authorization header.

This request will return a M3U playlist containing the streamable videos from the requested torrent.

Torrents - Getting Torrent Data

Request

To get additional torrent data (of torrents that have been previously added) use:

/actions?method=torrentData&id=08ada5a7a6183aae1e09d831df6748d566095a10

Where id is the infoHash received from the starting downloads or list available stream API requests.

Response

A typical response will be a JSON string in the form of:

{
  "name": "Sintel",
  "infoHash": "08ada5a7a6183aae1e09d831df6748d566095a10",
  "files": [
    {
      "length": 129241752,
      "id": "5",
      "name": "Sintel.mp4",
      "streamable": true,
      "progress": 4,
      "downloaded": "493.0 MB",
      "selected": true
    }
  ],
  "swarm":{
    "wires":{
      "length": 7
    },
    "downloadSpeed": 1146852.6,
    "uploadSpeed": 0,
    "downloaded": 4194304,
    "uploaded": 0,
    "paused": false
  },
  "total":{
    "length": 129302391
  },
  "isFinished": false,
  "opener": "magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel",
  "uploadedStart": 0,
  "path": false
}

The files array in this response uses an absolute order, which means that for all other purposes where you will need a file index, the order of this array is used to get that file index, which will be the same as the array index for the element.

Torrents - Transcoding

If you require streams that are transcoded for Web Browsers, then it is highly recommended that you use the embedding feature. Embedding has many advantages as it will also identify the user's browser and transcode the video accordingly for that particular browser. Embedding supports all stream types (torrents, youtube-dl, acestream, sopcast, etc.)

Example transcoding stream URL:

/web/08ada5a7a6183aae1e09d831df6748d566095a10/0/360p.mp4?token=fe4a644605bf5e3da9c12a2696645669&maxHeight=404&maxWidth=720&needsAudio=0&needsVideo=0&a=aac&v=h264&forAudio=-1&copyts=-1&forceTranscode=-1&useMatroska=1&audioDelay=0&start=0

This request will return a transcoded video directly.

For docs regarding transcoding torrents, refer to transcoding streams.

Torrents - Saving History

Example request:

/actions?method=updateHistory&filename=Sintel.mp4&time=9.481249&duration=888&infohash=08ada5a7a6183aae1e09d831df6748d566095a10&fileID=5&ended=false&isLocal=undefined&isYtdl=undefined

For more information on setting history, read the Setting History docs.

Torrents - Getting Subtitles

Request

Example request:

/actions?method=getSubs&infohash=08ada5a7a6183aae1e09d831df6748d566095a10&id=0

Breakdown of the request:

/actions?method=getSubs&infohash=${infoHash}&id=${fileIdx}

Response

A JSON string containing an array of subtitle objects in the form of:

[
  {
    "label": "Portuguese (BR)",
    "sublang": "pb",
    "src": "http://localhost:3000/srt2vtt/subtitle.vtt?token=a988b56c50bb6a55b944f293ac38c50c&from=aHR0cDovL2RsLm9wZW5zdWJ0aXRsZXMub3JnL2VuL2Rvd25sb2FkL3N1YmVuY29kaW5nLXV0ZjgvdnJmLTFhMDgwYzY2L2ZpbGUvMTk1Njc5Nzc2NC5zcnQ=",
    "ext": "srt"
  },
  ...
]

Where label is the subtitle language, sublang is the ISO 639-1 two letter code for the language, src is the download link for the subtitle and ext is the subtitle extension.

Torrents - Pause Torrent

Example request:

/actions?method=cancel&noDelete=true&infohash=08ada5a7a6183aae1e09d831df6748d566095a10

Where infohash is the torrent infohash which you can get from the torrent data or list available streams API requests.

Torrents - Resume Torrent

To resume a torrent, the simplest way is by requesting it's playlist:

/getplaylist.m3u?id=08ada5a7a6183aae1e09d831df6748d566095a10

Where id is the torrent infohash which you can get from the torrent data or list available streams API requests.

Torrents - Remove Torrent

Example request:

/actions?method=cancel&force=true&infohash=08ada5a7a6183aae1e09d831df6748d566095a10

Where infohash is the torrent infohash which you can get from the torrent data or list available streams API requests.

Youtube-DL Links

Youtube-DL Links - Starting and Streaming

Request

To start a new Youtube-DL Link download, use:

/actions?method=ytdlAdd&pid=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DEYSo692Cl68
  • The method parameter must be ytdlAdd

  • The pid parameter must be a URL encoded Youtube-DL supported link

Response

The response will be a JSON string in the form of:

{
  "pid": "httpswwwyoutubecomwatchvEYSo692Cl68",
  "utime": 1595184197986,
  "name": "Lounge Beats   Deep Jazzy House - by DJ Dimsa",
  "thumbnail": "https://i.ytimg.com/vi/EYSo692Cl68/hqdefault.jpg?sqp=-oaymwEZCNACELwBSFXyq4qpAwsIARUAAIhCGAFwAQ==&rs=AOn4CLA2WQg8Iu8WiQ4RoxXy1uuNpFPE1Q",
  "originalURL": "https://www.youtube.com/watch?v=EYSo692Cl68",
  "extracted": "...",
  "isYtdl": true
}

Notice extracted which includes the extracted stream from the Youtube-DL link.

Youtube-DL Links - Download Playlist

To download the playlist of a Youtube-DL link, use this request:

/getytdlplaylist.m3u?pid=httpswwwyoutubecomwatchvEYSo692Cl68&token=d65b35e7de4da52315db9793052db49b

Where pid is the pid received from the starting downloads or list available stream API requests and token is the user access token that is normally set as the authorization header.

This request will return a M3U playlist containing the streamable videos from the requested torrent.

Youtube-DL Links - Transcoding

If you require streams that are transcoded for Web Browsers, then it is highly recommended that you use the embedding feature. Embedding has many advantages as it will also identify the user's browser and transcode the video accordingly for that particular browser. Embedding supports all stream types (torrents, youtube-dl, acestream, sopcast, etc.)

Example transcoding stream URL:

/web/httpswwwyoutubecomwatchvEYSo692Cl68/0/360p.mp4?token=d65b35e7de4da52315db9793052db49b&maxHeight=360&maxWidth=480&needsAudio=0&needsVideo=0&a=aac&v=h264&forAudio=null&copyts=-1&forceTranscode=-1&useMatroska=1&audioDelay=0&isYtdl=1

This request will return a transcoded video directly.

Breakdown of the URL request:

/web/${infoHash}/${fileIdx}/${videoQuality}.mp4?token=${userAccessToken}&maxHeight=${maximumVideoHeight}&maxWidth=${maximumVideoWith}&needsAudio=${requiresAudioTranscoded}&needsVideo=${requiresVideoTranscoded}&a=${audioCodec}&v=${videoCodec}&forAudio=${audioTrack}&copyts=${copyTimestamp}&forceTranscode=${forceTranscoding}&useMatroska=${shouldUseMatroska}&audioDelay=${audioDelay}&start=${startTime}&isYtdl=${isYoutubeDlLink}

For Youtube-DL streams, the ${infoHash} is the pid from the starting downloads or list available stream API request.

The ${fileIdx} parameter should always be 0 for Youtube-DL streams.

The ${isYoutubeDlLink} parameter should always be 1 for Youtube-DL streams.

For more information regarding transcoding Youtube-DL links, refer to transcoding streams.

Youtube-DL Links - Saving History

Example request:

/actions?method=updateHistory&filename=Dua%20Lipa%2C%20Coldplay%2C%20Martin%20Garrix%20%26%20Kygo%2C%20The%20Chainsmokers%20Style%20-%20Feeling%20Me%20%2369&time=9.832819&duration=7152&infohash=httpswwwyoutubecomwatchvreslB6GXRHo&fileID=0&ended=false&isLocal=undefined&isYtdl=1

Compared to other saving history requests, ${isYoutubeDl} will always be 1, the ${filename} will be the video title, and the ${infoHash} will be the pid from the starting downloads or list available stream API request.

For more information on setting history, read the Setting History docs.

Youtube-DL Links - Remove Youtube-DL Link

Example request:

/actions?method=ytdlDestroy&pid=httpswwwyoutubecomwatchvreslB6GXRHo

Where pid is the pid from the starting downloads or list available stream API request.

AceStream Links

AceStream Links - Starting Downloads

Request

To start a new AceStream Link download, use:

/actions?method=ace&torrent=c4abdb6d30b1cdae74e1237868dc64d47dfcd714
  • The method parameter must be ace for this call.

  • The torrent parameter must be an AceStream infoHash (for example, if the AceStream link is acestream://c4abdb6d30b1cdae74e1237868dc64d47dfcd714 then the infoHash is c4abdb6d30b1cdae74e1237868dc64d47dfcd714)

Response

The response will be a JSON string in the form of:

{
  "hasAcestream": true
}

If hasAcestream is true, then the download started, if it is false, then AceStream was not configured on the Powder Web server.

AceStream Links - Ready to Stream

Request

To stream newly added AceStream links, you must first find when they are ready to be streamed, in order to do so, use this API call:

/actions?method=aceMsg&torrent=c4abdb6d30b1cdae74e1237868dc64d47dfcd714

Where torrent is the value used for acestream links - starting downloads or from the response of the list available streams API request.

Response

The typical response will be a JSON string in the form of:

{
  "utime": 1595185273869,
  "pid": "c4abdb6d30b1cdae74e1237868dc64d47dfcd714",
  "status": "Prebuffering 0%",
  "running": true,
  "isLive": true,
  "infohash": "a41915eababbf8d37ff5f96c0db70a289d1b206c",
  "name": "My Channel",
  "directLink": "http://127.0.0.1:3000/ace/c4abdb6d30b1cdae74e1237868dc64d47dfcd714/0?token=fe4a644605bf5e3da9c12a2696645669",
  "transcodeLink": "http://127.0.0.1:3000/hls/c4abdb6d30b1cdae74e1237868dc64d47dfcd714/fe4a644605bf5e3da9c12a2696645669/out.m3u8"
}

Notice directLink and transcodeLink from this response, these may not be available at the start. When directLink is available, then it is ready to stream (to video players with extended video codec support), when transcodeLink is ready then that is ready to stream (to web browsers).

AceStream Links - Download Playlist

To download the playlist of a AceStream link, use this request:

/getaceplaylist.m3u?pid=c4abdb6d30b1cdae74e1237868dc64d47dfcd714&token=d65b35e7de4da52315db9793052db49b

Where pid is the pid received from the list available stream API request and token is the user access token that is normally set as the authorization header.

This request will return a M3U playlist containing the streamable videos from the requested torrent.

AceStream Links - Transcoding

The transcoding link (web ready HLS) is available in the API response from AceStream Links - Ready to Stream as transcodeLink.

AceStream Links - Remove AceStream Link

Example request:

/actions?method=aceDestroy&pid=c4abdb6d30b1cdae74e1237868dc64d47dfcd714

Where pid is the pid received from the list available stream API request.

SopCast Links

SopCast Links - Check if Enabled

Request

To check if SopCast is enabled use:

/actions?method=haveSop

Response

The response will be a JSON string in the form of:

{
  "hasSopcast": true
}

If hasSopcast is true, then SopCast is enabled and you can stream it, if it is false, then SopCast is not enabled in Powder Web.

SopCast Links - Starting Downloads

A typical SopCast link is in the form of sop://185.122.61.8:3938/221961.

Request

To start a new SopCast Link download, use:

/actions?method=sop&torrent=sop%3A%2F%2F185.122.61.8%3A3938%2F221961
  • The method parameter must be sop for this call.

  • The torrent parameter must be a URL encoded SopCast Link (for example: sop://185.122.61.8:3938/221961)

Response

The response will be a JSON string in the form of:

{
  "hasSopcast": true
}

If Sopcast is true, then the download started, if it is false, then SopCast was not configured on the Powder Web server.

SopCast Links - Ready to Stream

Request

To stream newly added AceStream links, you must first find when they are ready to be streamed, in order to do so, use this API call:

/actions?method=sopMsg&torrent=sop1851225983912256238

Where torrent is the pid value from the list available streams API request.

Response

The typical response will be a JSON string in the form of:

{
  "utime": 1595240430438,
  "name": "SopCast Channel",
  "pid": "sop1851225983912256238",
  "status": "Starting Download",
  "running": false,
  "isLive": true,
  "isSopcast": true,
  "directLink": "http://127.0.0.1:63517/",
  "sopUrl": "sop://185.122.61.8:3938/221961"
}

Notice directLink and transcodeLink from this response, these may not be available at the start. When directLink is available, then it is ready to stream (to video players with extended video codec support), when transcodeLink is ready then that is ready to stream (to web browsers).

SopCast Links - Download Playlist

A typical SopCast link is in the form of sop://185.122.61.8:3938/221961.

To download the playlist for this example SopCast link, use:

/getsopplaylist.m3u?pid=sop%3A%2F%2F185.122.61.8%3A3938%2F221961&token=11de62fad136c60307bcb5dedaf33992

Where pid is the URL encoded SopCast link (for this example: sop://185.122.61.8:3938/221961) and token is the user access token that is normally set as the authorization header.

This request will return a M3U playlist containing the streamable videos from the requested torrent.

Note: This request will also add this SopCast link to the downloads list.

SopCast Links - Transcoding

The transcoding link (web ready HLS) is available in the API response from SopCast Links - Ready to Stream as transcodeLink.

SopCast Links - Remove SopCast Link

Example request:

/actions?method=sopDestroy&pid=sop1851225983912256238

Where pid is the pid from the list available streams API request.

Local Media

Local Media - Adding Local Media

Local media cannot be added through the API, if you have a legitimate use case for this, please create an issue for it. Until then, for security concerns, local media can only be added through the GUI.

Local Media - Download Playlist

Example request:

/getlocalplaylist.m3u?pid=1595244791277&token=a982b56b50bb6a55b944f293ac38c50c

Where pid is the pid from the list available streams API request and token is the user access token that is normally set as the authorization header.

This request will return a M3U playlist containing the streamable videos from the requested torrent.

Local Media - Transcoding

Example request:

/web/1595244791277/0/720p.mp4?token=a982b56b50bb6a55b944f293ac38c50c&maxHeight=720&maxWidth=1280&needsAudio=-1&needsVideo=0&a=aac&v=h264&forAudio=null&copyts=-1&forceTranscoding=-1&useMatroska=1&audioDelay=0&isLocal=1

This request will return a transcoded video directly.

Breakdown of the URL request:

/web/${infoHash}/${fileIdx}/${videoQuality}.mp4?token=${userAccessToken}&maxHeight=${maximumVideoHeight}&maxWidth=${maximumVideoWith}&needsAudio=${requiresAudioTranscoded}&needsVideo=${requiresVideoTranscoded}&a=${audioCodec}&v=${videoCodec}&forAudio=${audioTrack}&copyts=${copyTimestamp}&forceTranscode=${forceTranscoding}&useMatroska=${shouldUseMatroska}&audioDelay=${audioDelay}&start=${startTime}&isLocal=${isLocalFile}

For local media streams, the ${infoHash} is the pid from the response of the list available stream API request.

The ${fileIdx} parameter should always be 0 for local media streams.

The ${isLocalFile} parameter should always be 1 for local media streams.

For more information regarding transcoding local media links, refer to transcoding streams.

Local Media - Saving History

Example request:

/actions?method=updateHistory&filename=Sintel.mp4&time=4.152596&duration=888&infohash=1595244791277&fileID=0&ended=false&isLocal=1&isYtdl=undefined

Compared to other saving history requests, ${isLocal} will always be 1, the ${filename} will be the video filename, and the ${infoHash} will be the pid from the response of the list available stream API request.

For more information on setting history, read the Setting History docs.

Local Media - Getting Subtitles

Request

Example request:

/actions?method=getSubs&infohash=1595246625795&id=0

Breakdown of the request:

/actions?method=getSubs&infohash=${pid}&id=${fileIdx}
  • ${pid}: the pid from the response of the list available stream API request
  • ${fileIdx}: the file index of the video in the folder (starts from 0, will commonly be 0 if the folder only contains one media file)

Response

A JSON string containing an array of subtitle objects in the form of:

[
  {
    "label": "Portuguese (BR)",
    "sublang": "pb",
    "src": "http://localhost:3000/srt2vtt/subtitle.vtt?token=a988b56c50bb6a55b944f293ac38c50c&from=aHR0cDovL2RsLm9wZW5zdWJ0aXRsZXMub3JnL2VuL2Rvd25sb2FkL3N1YmVuY29kaW5nLXV0ZjgvdnJmLTFhMDgwYzY2L2ZpbGUvMTk1Njc5Nzc2NC5zcnQ=",
    "ext": "srt"
  },
  ...
]

Where label is the subtitle language, sublang is the ISO 639-1 two letter code for the language, src is the download link for the subtitle and ext is the subtitle extension.

Local Media - Remove Local Media

Example request:

/actions?method=locDestroy&pid=1595244791277

Where pid is the pid from the list available streams API request.

Clone this wiki locally