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.


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


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

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.


Now read this

Haskell: Project Euler 6-10

Due to the popularity of my previous post on the same subject (click here if you haven’t read it), I decided to write a sequel tackling problems 6 through 10. It will be the last one about Project Euler and I hope this pair of articles... Continue →