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]" --list
copy

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

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

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

SYNOPSIS

peerflix [options]

PARAMETERS


    Torrent file, magnet link or infohash to stream. Required.

--port
    Port for the HTTP server (default: 8888).

--vlc
    Use VLC as the player (defaults to system's default player).

--mpv
    Use MPV as the player.

--mplayer
    Use MPlayer as the player.

--omx
    Use OMXplayer as the player (Raspberry Pi).

--airplay
    Stream to AirPlay.

--dlna
    Stream to DLNA.

--i
    Network interface for torrent (default: your default interface).

--title
    Title for the stream (shown in VLC or other players).

--blocklist
    Path to blocklist file (e.g., for anti-piracy blocklists).

--connections
    Maximum number of connections (default: 100).

--max-requests
    Maximum number of simultaneous HTTP requests to serve (default: unlimited).

--path
    Path to store downloaded files.

--on-downloaded
    Executes command after the file is fully downloaded.

--not-on-downloaded
    Executes command until the file is fully downloaded.

DESCRIPTION

Peerflix is a command-line tool that allows you to stream torrents directly to a media player like VLC or mpv without having to download the entire file first. It leverages the torrent protocol to fetch and play video content on demand. This is useful for quickly previewing or watching torrents without committing to a full download. Peerflix is commonly used by developers or advanced users comfortable with the command line.

It essentially acts as a media server that streams the selected torrent content. Once initiated, Peerflix opens the torrent in a player, making it immediately accessible for viewing. It provides a quick, interactive, and efficient way to engage with torrent content directly via the command line. It relies on Node.js to run, so Node.js must be installed on your system to use this command.

CAVEATS

Requires Node.js and npm to be installed. The media player used must be compatible with streaming HTTP video. Streaming quality may vary depending on torrent availability and network conditions.

INSTALLATION

To install Peerflix, you need Node.js and npm (Node Package Manager).
Open your terminal and run: npm install -g peerflix

EXAMPLES

  • Stream a torrent file: peerflix movie.torrent
  • Stream a magnet link using MPV player: peerflix 'magnet:?xt=urn:btih:...' --mpv
  • Stream a torrent and store download files in /tmp folder: peerflix movie.torrent --path /tmp

DEPENDENCIES

Peerflix depends on torrent-stream module, which is a torrent client that supports streaming. It also needs a compatible media player installed on your system, such as VLC, MPV, or MPlayer.

HISTORY

Peerflix was developed to provide a command-line interface for streaming torrents directly to a media player. It gained popularity amongst users comfortable with the command line who wanted a quick and easy way to watch torrents without needing to download the entire file first. Its usage has grown with the increasing availability of torrents and the need for more flexible streaming solutions.

Copied to clipboard