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:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
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.
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
By default it will spin up a HTTP Server listening on port 9090.
// 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
Copyright (c) 2014 Simon Kusterer Licensed under the MIT license.