Showing posts with label peerflix. Show all posts
Showing posts with label peerflix. Show all posts

Sunday, October 18, 2015

Peerflix: Stream Torrents With VLC Or MPlayer Via Command Line

Peerflix is an experimental video streaming BitTorrent client for Node.js. The tool can be used to stream video torrents via command line and play the stream with your favorite video player, such as VLC or MPlayer.

Peerflix Ubuntu VLC

Peerflix supports supports setting the maximum number of connections, changing the port, loading subtitles and more.

The application even supports streaming torrents with multiple video files, although I'm not sure if the video files are played in order (if you try it, let us know in the comments).

Peerflix is actually what Popcorn Time uses under the hood, but you can use it separately so you can stream any video torrent and use any video player you want.


Install Peerflix in Ubuntu


Peerflix should work with most Linux distributions, but the instructions below are for Ubuntu only. For other Linux distributions, install Node.js, then install Peerflix using "npm install -g peerflix".

1. To install Peerflix in Ubuntu, firstly you'll have to add the Node.js PPA and install nodejs:
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

2. Next, install Peerflix using the following command:
sudo npm install -g peerflix

Update -> Arch Linux users can install Peerflix via AUR: stable | git.


Optional: Firefox integration (via Pinguy)


Pinguy shared some tweaks for integrating Firefox with Peerflix for both regular torrents and magnet links. Using these tweaks, you'll be able to open torrent files and magnet links from Firefox with Peerflix and directly play them with VLC.

Below you can watch a quick video I recorded a few minutes ago, demoing Peerflix (with VLC) streaming torrents directly from Firefox:


(direct video link)


To set up these tweaks, use the instructions below (requires VLC).

Setting this in Chrome is more complicated, here's an example.

1. Firstly, install vlc, xterm, python-libtorrent and wget:
sudo apt-get install vlc xterm python-libtorrent wget

2. To be able to open torrent files from Firefox and play them with VLC via Peerflix, use the commands below:
wget https://raw.github.com/hotice/failsdownloads/master/Torrent-Video-Player -O /tmp/Torrent-Video-Player
sudo install /tmp/Torrent-Video-Player /usr/local/bin/
Then, open your web browser and click a video torrent. When it asks what app to use, select Other and browse for /usr/local/bin/Torrent-Video-Player

3. For Magnet Links support, use the commands below:
wget https://raw.github.com/danfolkes/Magnet2Torrent/master/Magnet_To_Torrent2.py -O /tmp/Magnet_To_Torrent2.py
sudo install /tmp/Magnet_To_Torrent2.py /usr/local/bin/
wget https://raw.github.com/hotice/failsdownloads/master/Magnet-Video-Player -O /tmp/Magnet-Video-Player
sudo install /tmp/Magnet-Video-Player /usr/local/bin/
And just like above, open Firefox, click a magnet link, select Other and browser for /usr/local/bin/Magnet-Video-Player


Using Peerflix


Using the extra tweaks above, you basically don't have to do anything else. But if you want to use Peerflix manually (for instance, to use your favourite video player), here's a quick guide.

To stream a torrent with Peerflix and play it with VLC, use the following command:
peerflix http://some-torrent/movie.torrent --vlc
(replacing "some-torrent/movie.torrent with the link to a video torrent file)

Example:
peerflix http://download.stefan.ubbink.org/ToS/tears_of_steel_1080p.webm.torrent --vlc

To automatically play the video in MPlayer instead of VLC, use the following command:
peerflix http://some-torrent/movie.torrent --mplayer

If you don't want to use VLC or MPlayer, simply don't append "--vlc" or "--mplayer" to the Peerflix command. Example:
peerflix http://download.stefan.ubbink.org/ToS/tears_of_steel_1080p.webm.torrent

Peerflix

Then open some video player like Totem for instance, select to open location and enter the location displayed by Peerflix ("http://192.168.1.6:8888/" in my case - see screenshot above).

It's also worth mentioning that you don't have to use a torrent link - you can use Peerflix with a locally saved torrent file too:
peerflix somevideo.torrent

Peerflix also supports setting the maximum number of connections, changing the port, loading subtitles and more. Here's the complete list of options:
$ peerflix --help
Usage: peerflix torrent_file_or_url [options]

Options:
-c, --connections max connected peers [default: 100]
-p, --port change the http port [default: 8888]
-i, --index changed streamed file (index)
-t, --subtitles load subtitles file
-q, --quiet be quiet
-v, --vlc autoplay in vlc*
-m, --mplayer autoplay in mplayer**
-o, --omx autoplay in omx**
-j, --jack autoplay in omx** using the audio jack
--clean remove the tmp buffer file after peerflix closes
--path change buffer file path

*Autoplay can take several seconds to start since it needs to wait
for the first piece
*OMX player is the default Raspbian video player
Read more »

Tuesday, October 6, 2015

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.

Peertv

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 optionally: subliminal and notify-send.

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 libnotify-bin
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 https://gitorious.org/peertv/peertv-bash.git
cd peertv-bash
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-bash

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


The first time you run peertv (so run "peertv" in a terminal), it creates a configuration file under: ~/.config/peertv.conf

To see all the available configuration options, run the following command:
peertv config

To change some configuration options, use:
peertv set <configuration> <value>

For instance, to set the default subtitle language to English, use:
peertv set subtitle en
Modify these configuration options 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), 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 https://eztv.it/showlist/, copy the show link (Game of Thrones in our example) and add it to PeerTV, like this:
peertv add thrones https://eztv.it/shows/481/game-of-thrones/
("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.
Read more »