LinuxCommandLibrary

peerflix

Stream torrent videos without fully downloading

TLDR

Stream the largest media file in a torrent

$ peerflix "[torrent_url|magnet_link]"
copy

List all streamable files contained in a torrent (given as a magnet link)
$ peerflix "[magnet:?xt=urn:btih:0123456789abcdef0123456789abcdef01234567]" [[-l|--list]]
copy

Stream the largest file in a torrent, given as a torrent URL, to VLC
$ peerflix "[http://example.net/music.torrent]" [[-v|--vlc]]
copy

Stream the largest file in a torrent to MPlayer, with subtitles
$ peerflix "[torrent_url|magnet_link]" [[-m|--mplayer]] [[-t|--subtitles]] [subtitle-file.srt]
copy

Stream all files from a torrent to Airplay
$ peerflix "[torrent_url|magnet_link]" [[-a|--all]] [[-s|--airplay]]
copy

SYNOPSIS

peerflix [options] <torrent-file | magnet-link>

PARAMETERS

-h, --help
    Print usage information

-p, --port <n>
    Port to bind server to (default: 5984)

--hostname <s>
    Hostname/IP to bind to (default: 127.0.0.1)

--index <path>
    Custom index.html file to serve

--admin <path>
    Custom admin.html file to serve

--no-player
    Disable serving the built-in player page

--all
    Serve all files in torrent, not just media

-v, --verbose
    Enable verbose logging

--title <string>
    Custom page title

DESCRIPTION

Peerflix is a Node.js-based command-line tool for streaming torrent files to your web browser without fully downloading them first. It leverages peer-to-peer (P2P) technology to serve media content via a local HTTP server as pieces are fetched from peers.

Launch it with a torrent file or magnet link, and it automatically opens your default browser to a local URL (default: http://localhost:5984). The interface includes a video player for media files and lists other torrent contents. Supports playlists, subtitles, and multiple files.

Ideal for quick playback of videos, music, or other media from torrents. It integrates with popular torrent trackers and works cross-platform on Linux, macOS, and Windows. However, it's lightweight and focuses solely on streaming, not full downloads.

CAVEATS

Requires Node.js and global npm install: npm i -g peerflix.
Project is unmaintained since ~2017; consider alternatives like WebTorrent.
Torrent use may involve legal risks based on content.
Exposes local server; bind to localhost for security.

INSTALLATION

npm install -g peerflix
Requires Node.js ≥ 10.

EXAMPLE

peerflix example.torrent
Opens browser to stream largest video file.
peerflix 'magnet:?xt=urn:btih:HASH'

HISTORY

Created by mafintosh (Mathias Buus) in 2013 as part of Node.js streaming experiments. Gained popularity for browser-based torrent playback. Integrated into WebTorrent ecosystem but later deprecated in favor of webtorrent-cli.

SEE ALSO

Copied to clipboard