Highlighting, added examples, fixed small title stuff

This commit is contained in:
Anders Jensen
2018-09-17 21:50:23 +02:00
parent de54ed067a
commit 1398e5042b

View File

@@ -51,12 +51,12 @@ The _allow remote_ option is to allow remote add and stream of torrents.
# HTTP API Usage # HTTP API Usage
# Prerequisite ## Prerequisite
Install and enable the plugin. Afterwards, head into Streaming settings and enable "Allow remote control". Install and enable the plugin. Afterwards, head into Streaming settings and enable "Allow remote control".
The URL found in the "Remote control url" field is where the API can be reached. The auth used is Basic Auth. The URL found in the "Remote control url" field is where the API can be reached. The auth used is Basic Auth.
# Usage ## Usage
There is only one end-point and that is where a torrent stream can be requested. There is only one end-point and that is where a torrent stream can be requested.
@@ -69,23 +69,35 @@ POST body must be the raw torrent you want to stream. No form formatting or anyt
List of URL GET Arguments List of URL GET Arguments
* path: Path inside the torrent file to either a folder or a file you want to stream. The plugin will try to guess the best one. Optional. Default: '' (i.e. find the best file in the whole torrent) * **path**: Path inside the torrent file to either a folder or a file you want to stream. The plugin will try to guess the best one. **Optional**. **Default**: '' (i.e. find the best file in the whole torrent)
* infohash: Infohash of the torrent you want to stream, can make it a bit faster as it can avoid reading POST body. Optional. * **infohash**: Infohash of the torrent you want to stream, can make it a bit faster as it can avoid reading POST body. **Optional**.
* label: If label plugin is enabled and the torrent is actually added then give the torrent this label. Optional. Default: '' * **label**: If label plugin is enabled and the torrent is actually added then give the torrent this label. **Optional**. **Default**: ''
* wait_for_end_pieces: Wait for the first and last piece in the streamed file to be fully downloaded. Can be necessary for some video players. It also enforces that the torrent can be actually downloaded. If the key exist with any (even empty) value, the feature is enabled. Optional. Default: false * **wait_for_end_pieces**: Wait for the first and last piece in the streamed file to be fully downloaded. Can be necessary for some video players. It also enforces that the torrent can be actually downloaded. If the key exist with any (even empty) value, the feature is enabled. **Optional**. **Default**: false
## GET /streaming/stream ## GET /streaming/stream
* infohash: Does the same as when POSTed. Mandatory. * **infohash**: Does the same as when POSTed. **Mandatory**.
* path: Does the same as when POSTed. * **path**: Does the same as when POSTed. **Optional**.
* wait_for_end_pieces: Does the same as when POSTed. * **wait_for_end_pieces**: Does the same as when POSTed. **Optional**.
## Success Response ## Success Response
```json
{ {
"status": "success" "status": "success", # Always equals this
"filename" "horse.mkv", # Filename of the streamed torrent
"url": "http://example.com/" # URL where the file can be reached by e.g. a media player
} }
```
## Error Response
```json
{
"status": "error", # Always equals this
"message" "Torrent failed" # description for why it failed
}
```
# Version Info # Version Info