Get p2ptube


p2ptube is a program to stream movies on the internet. Its completely free and its open source. Once you start the program you will get a menu with movies that you can search and filter. Once you have picked a movie, click on it, and the movie will start playing in a matter of seconds. The movies available are the ones that are available in the bitorrent network, in other words, almost all movies that you might be interested in watching.


Future releases

p2ptube is still in an early stage of development. future releases will have the following planned features.

Keyboard shortcuts

btcat, a command line bittorrent streamer

The core of p2ptube is a very small program called btcat. It's a python program that downloads a bittorrent file sequentially. You can use it to watch video files as they download.

Install (Ubuntu)
sudo apt-get install python-libtorrent mplayer
sudo wget -O /usr/local/bin/btcat
sudo chmod +x /usr/local/bin/btcat
  to list the contents of a torrent file
btcat ''
  to play a specific file run the command again appending the file id as the second argument
btcat '' 1

How it works

In the BitTorrent protocol, big files are divided into small sections. Different sections don't always have the same availability, it is possible for instance that 10 users have section A while only 3 users have section B, even if both sections belong to the same file. For this reason BitTorrent clients tend to download sections with high availability first so that it can use as much bandwith as possible. This means that usually we wont download the file from the beginning to the end consecutively, but instead we will dowload (aparently) random pieces (the ones with higher availability) until the file is complete. This is a problem if we want to stream the file while we are downloading, as we can't start streaming until the first section has been completed. And after the first section has been completed, we won't be able to continue until the second has been finished too and so on. If we don't change the strategy, this process can be quite slow at the beginning as its very unlikely that the "efficient algorithm" is going to choose to download the next section we need to stream.

p2ptube uses a different strategy which prioritizes the first sections over later ones. This will ensure that we can read the file from the beginning and start processing it (playing it in this case) as soon as possible before the whole download has been completed. This comes at some price of course, that is a slighty lower download rate. But do we really care about high download rates if the rate is high enough to watch the movie as it downloads?