Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including torrentcast with all npm packages installed. Try it out:

var torrentcast = require("torrentcast")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

torrentcast v0.1.2

raspberry pi torrentcast

torrentcast

torrentcast builds a REST API around peerflix and omxplayer. omxplayer is a commandline player especially build for usage on a raspberry pi. peerflix on the otherhand is a small lib/tool written for node which enables streaming of video torrents before they even finished downloading.

Installation

Make sure you have omxplayer and node.js installed on your raspberry. Then run:

npm install torrentcast -g

You can now start the server by running torrentcast. By default it will spin up a HTTP Server listening on port 9090.

Usage

// Assuming your Raspberry PI has the IP 192.168.0.10...

// Start playing a torrent
curl --data "url=<URL to Torrent File>" http://192.168.0.10:9090/play

// Toggle between pause and play
curl -XPOST http://192.168.0.10:9090/pause

// Stop playing
curl -XPOST http://192.168.0.10:9090/stop

// Increase volume
curl -XPOST http://192.168.0.10:9090/volumeup

// Decrease volume
curl -XPOST http://192.168.0.10:9090/volumedown

// Get the current State.
// Can be: PLAYING, PAUSED or IDLE
curl http://192.168.0.10:9090/state

License

Copyright (c) 2014 Simon Kusterer Licensed under the MIT license.

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free