Skip to content

Commit

Permalink
Highlighting, added examples, fixed small title stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders Jensen committed Sep 17, 2018
1 parent de54ed0 commit 1398e50
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ The _allow remote_ option is to allow remote add and stream of torrents.

# HTTP API Usage

# Prerequisite
## Prerequisite

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.

# Usage
## Usage

There is only one end-point and that is where a torrent stream can be requested.

Expand All @@ -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

* 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.
* 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
* **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**.
* **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

## GET /streaming/stream

* infohash: Does the same as when POSTed. Mandatory.
* path: Does the same as when POSTed.
* wait_for_end_pieces: Does the same as when POSTed.
* **infohash**: Does the same as when POSTed. **Mandatory**.
* **path**: Does the same as when POSTed. **Optional**.
* **wait_for_end_pieces**: Does the same as when POSTed. **Optional**.

## 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

Expand Down

0 comments on commit 1398e50

Please sign in to comment.