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 1-5

According to it’s website Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and... Continue →