Sep 12, 2014

PeerTV: Command-Line Tool To Manager And Play TV Series From EZTV Via Peerflix

PeerTV is a command line tool for manage and play TV series from EZTV.it. It uses Peerflix to stream the torrents and by default, the videos are played with mpv, but that can be changed from the PeerTV configuration file.






For those not familiar with Peerflix, this is a an experimental video streaming BitTorrent client for Node.js which can be used to stream video torrents via command line and play the stream with your favorite video player, such as VLC or MPlayer.



PeerTV allows you to easily keep track of your watched / unwatched episodes: each viewed episode is automatically marked as seen and you can manually mark/unmark episodes as viewed - and of course, you play them with the help of Peerflix, with subtitles support.




For downloading subtitles, PeerTV uses subliminal, a Python library and command line tool which supports subtitle websites such as Addic7ed, OpenSubtitles, Podnapisi, TheSubDB and TvSubtitles.



Important note: PeerTV uses Peerflix to stream TV shows from torrents and that may be illegal in your country. Use at your own risk!





Install PeerTV




1. PeerTV depends on bash, sed, wget, rt, sqlite3, peerflix, mpv (or some other video player) and subliminal.



In Ubuntu / Linux Mint, most of these should be installed by default and for the rest, use the following commands to install them along with python-pip, which we'll use to install subliminal (and "git", to get the latest PeerTV under step 3):


sudo apt-get install wget git sqlite3 python-pip mpv
sudo pip install subliminal




2. You'll also need Peerflix - for how to install Peerflix, see THIS article.



3. And finally, download and install PeerTV using the following commands:


cd && git clone http://ift.tt/1xTHeO7
cd peertv
sudo PREFIX="/usr/local" make install




You can also download PeerTV manually from HERE.



Later on if you want to update PeerTV, navigate to its directory (assuming you've used the commands above, it should be in your home folder):


cd ~/peertv



And update it using the following commands:


git pull
sudo PREFIX="/usr/local" make install



Arch Linux users can install PeerTV via AUR.





Configure PeerTV




To change various PeerTV options, create a configuration file at: ~/.config/peertv.conf and paste the following (these are the defaults at the time I'm writing this article):


PREFEREDHD="true" # true for play 720p videos when available.
PEERFLIX_OPTIONS="-p 8888" # Options for peerflix.
PEERFLIX_TIMEOT=30 # Maximum time for waiting for peerflix peers.
AUTOMARK="true" # 'true' to automatically mark the episodes after play it.
SUBTITLE="en" # Subtitle language.
SUBTITLE_TIMEOUT=30 # Maximum time to find subtitles.
MPLAYER_COMMAND="mpv" # Adapt to your video player.
MPLAYER_OPTIONS="-fs http://localhost:8888" # Adapt to your video player.
MPLAYER_SUBOPT="--sub-file=" # Adapt to your video player.




Modify these variables to suit your needs - as you can see, here you can set the video player to use for playing TV episodes (but, depending on the video player you set, you'll also need to change the other "MPLAYER_" options!), port (for instance, I already had something running on port 8888 so I had to change it to 8887 to get PeerTV to work), subtitle language and so on.





How to use PeerTV




For the commands below, I'll use "Game of Thrones" with the "thrones" shortname as an example - replace these with the TV shows you want to add.



To use it, firstly visit the EZTV show list at http://ift.tt/1BydqoE, copy the show link (Game of Thrones in our example) and add it to PeerTV, like this:


peertv add thrones http://ift.tt/1xTHeO9

("thrones" can be anything and it will be used as the shortname for the TV series - Game of Thrones in this case)



Next, update the series with magnet links from EZTV using the command below:


peertv update thrones

(or, use "all" instead of "thrones" to update all the TV series you've added)



You can list all the episodes of a series by using the command below:


peertv list thrones



You can mark episodes as viewed using the following command (the command below marks Game of Thrones episode 1 from season 1, as seen):


peertv mark thrones 1x1



You can also mark multiple episodes - here's an example in which you'll mark all episodes up to season 3 episode 6 as viewed (from Game of Thrones):


peertv mark thrones "<3x6"



To view all the PeerTV available options, run:


peertv help



More examples, etc. available at PeerTV's Gitorious page.






via Web Upd8 - Ubuntu / Linux blog http://ift.tt/1Bydq8n