Raspberry Pi: Torrent streaming with 4 lines of code

I recently found a tiny sequential bittorrent downloading tool named btcat and decided to use it to be able to stream torrents on the Raspberry Pi. Turns out it only required a simple bash script with four lines of code.

 Installation

Install btcat on your Raspberry Pi by following the instructions on the website (but skip installing mplayer, it does not support GPU acceleration which makes it super-laggy).

 Source

Create a file with the following content and name it btstream.

#!/bin/bash
mkfifo stream
btcat "$1" 0 > stream &
omxplayer stream
rm stream

You’re done! Now you can stream any torrent containing a media file simply by issuing ./btstream <torrent_url> (it needs chmod +x).

 Follow up

Check out my yts.re python wrapper using the above bash script.

 
21
Kudos
 
21
Kudos

Now read this

Raspberry Pi: yts.re python wrapper

A YIFY-Torrents API wrapper written in python 3.41, which combined with btstream from my previous post serves as a command-line media center. Dependencies Python 3.41 (included by default) btstream (for torrent streaming) Usage Options... Continue →