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
#!/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
Check out my yts.re python wrapper using the above bash script.