Streaming torrent client for node.js

Related tags

Mad science peerflix
Overview

peerflix

Streaming torrent client for Node.js

npm install -g peerflix

build status

Usage

Peerflix can be used with a magnet link or a torrent file. To stream a video with its magnet link use the following command.

peerflix "magnet:?xt=urn:btih:ef330b39f4801d25b4245212e75a38634bfc856e" --vlc

Remember to put " around your magnet link since they usually contain &. peerflix will print a terminal interface. The first line contains an address to a http server. The --vlc flag ensures vlc is opened when the torrent is ready to stream.

peerflix

To stream music with a torrent file use the following command.

peerflix "http://some-torrent/music.torrent" -a --vlc

The -a flag ensures that all files in the music repository are played with vlc. Otherwise if the torrent contains multiple files, peerflix will choose the biggest one. To get a full list of available options run peerflix with the help flag.

peerflix --help

Examples of usage of could be

peerflix magnet-link --list # Select from a list of files to download
peerflix magnet-link --vlc -- --fullscreen # will pass --fullscreen to vlc
peerflix magnet-link --mplayer --subtitles subtitle-file.srt # play in mplayer with subtitles
peerflix magnet-link --connection 200 # set max connection to 200

Programmatic usage

If you want to build your own app using streaming bittorrent in Node you should checkout torrent-stream

Chromebook users

Chromebooks are set to refuse all incoming connections by default - to change this:

sudo iptables -P INPUT ACCEPT

Chromecast

If you wanna use peerflix on your chromecast checkout peercast or castnow

License

MIT

Comments
  • Replaced read-torrent with parse-torrent. Info hashes are now supported.

    Replaced read-torrent with parse-torrent. Info hashes are now supported.

    This adds support for calls like: peerflix "ef330b39f4801d25b4245212e75a38634bfc856e" --vlc for when you don't have a magnet or torrent link and you're too lazy to convert the hash to a magnet link yourself.

    opened by goibon 22
  • Peerflix NPAPI

    Peerflix NPAPI

    How about making a browser NPAPI plugin based on Peerflix and Firebreath (not sure if it supports node.js)? There aren't any working / stable solutions out there for a plugin that simply plays torrents (except Ace Stream, but they are closed source and do black hat marketing on your PC).

    As long as the plugin will be open source and reliable, I can really see this having a place in the online world. I remember Ninja Video (website) that made their own streaming plugin and they had more then 1 million unique visitors daily, so visitors installing a plugin for something like this seems ok to me.

    It could come bundled with WebChimera Plugin (which is highly customizable) for video format support and I could make a fork of WebChimera Player to also fetch subtitles from the OpenSubtitles API. It would practically be a "Popcorn Time" plugin for websites, and I'm sure a lot of web developers would have fun playing with something like this.

    I know this is what Feross plans on doing without plugins and that should be the proper course of things knowing that NPAPI support will be ended in late 2015 by Chrome (and maybe FireFox).

    But bringing Peerflix to websites with a browser plugin might be the best way to also start seeding through WebRTC and help WebTorrent grow into the future pluginless implementation of this concept. :)

    opened by jaruba 16
  • Open the file in VLC instead of streaming

    Open the file in VLC instead of streaming

    When running peerflix with --vlc, it streams and doesn't open the file. There might be some pros for that, but when having subtitles, they are not able to recognize when it started. Seeking in a video messes up subtitles. However, when opening the file from tmp folder, VLC is able to run it just fine and the subtitles are displayed correctly even when seeking. I don't see any negative effect on opening a video file instead of streaming it.

    opened by zouharvi 16
  • Chrome integration

    Chrome integration

    Is there any way to stream torrent directly from chrome ? Like we can do with firefox by selecting "Open with Torrent Video Player" A plugin for example

    opened by melkir 15
  • [Issue] TypeError: Cannot read property 'value' of undefined

    [Issue] TypeError: Cannot read property 'value' of undefined

    Hi guys ! :smiley: I have just installed peerflix with nodejs and npm. The problem is when I type the basic command to use with vlc, I get this error : ------------------- C:\Users\sjboy>peerflix "C:\Users\sjboy\Downloads\J'irai.dormir.chez.vous-S06E02-Uruguay-09.07.2015.torrent" --vlc C:\Users\sjboy\AppData\Roaming\npm\node_modules\peerflix\app.js:223 var vlcPath = key['InstallDir'].value + path.sep + 'vlc' ^ TypeError: Cannot read property 'value' of undefined at Server. (C:\Users\sjboy\AppData\Roaming\npm\node_modules\peerflix\app.js:223:40) at Server.emit (events.js:104:17) at net.js:1171:12 at process._tickCallback (node.js:355:11) -------------------

    So, I ask you to help me to fix this problem. Thanks !

    opened by jounlye 14
  • Add MPC-HC support

    Add MPC-HC support

    @mpc-hc is one of the windows media players. It has support for loading streams and files ofc. Shouldn't be too hard to add support for it.

    Thanks in advance.

    opened by vBm 14
  • How to install it on debian (wheezy, ARMv7)?

    How to install it on debian (wheezy, ARMv7)?

    Hello, I am not big professional in linux, but sometime I'm using it and even do some tests. So, I have a router Linksys EA6900, with pretty powerful CPU and hardware, and I have TV with Smart TV that can read any DLNA stream. My plan is somehow to transform Torrent stream into IPTV (with peerflix of course), but I have several issues:

    • how install it on debian (I have some kind of debian on my router - wheezy), on my architecture - ARMv7 ?
    • how to convert output of streaming into IPTV ?

    Thank you so much for your hard work!

    opened by ghost 13
  • How can I install it in Ubuntu 13.10?

    How can I install it in Ubuntu 13.10?

    First of all thank you very much for your open source project. I downloaded it and run npm install -g peerflix but I got some error messages. I use node and npm from Ubuntu repositories. Do I need latest versions of it? Which extra packages do I need to install? Regards

    opened by trappedinspacetime 13
  • error while installing peerflix using npm

    error while installing peerflix using npm

    error installing [email protected]

    npm ERR! Error: No compatible version found: mime@'^1.2.11' npm ERR! Valid install targets: npm ERR! ["1.0.0","1.1.0","1.2.1","1.2.2","1.2.3","1.2.4","1.2.5","1.2.6","1.2.7","1.2.8","1.2.9","1.2.10","1.2.11"]

    opened by yspanchal 13
  • Question: url to stream in browser

    Question: url to stream in browser

    Hi,

    I'd like to possibly use the url that is emitted from peerflix to stream video in the browser. I'm wondering what the best way to do this might be? Also, do I need to always have the vlc flag on in order to get the url?

    Thanks.

    opened by mwilc0x 12
  • support for magnet links

    support for magnet links

    i'd like to be able to pass peerflix a magnet uri. i'm currently wrestling with trying to generate a .torrent file from a magnet link, then pass it to peerflix, but am struggling to get it right.

    any sign of magnet support in the future?

    opened by 44203 12
  • Add some extra features and fixed somes bugs

    Add some extra features and fixed somes bugs

    now you can see the remaining time for torrent download. time And also you can also see how many percentage of files you have downloaded, which files are downloaded and which ones are left to do. Also I fixed the bug concerning the download for example the command : peerflix "torrent.torrent" --list downloaded When you click on ctrl+c it is impossible to stop the script.

    opened by meteor314 0
  • Getting BAD_PORT_RANGE on node v17.0.1

    Getting BAD_PORT_RANGE on node v17.0.1

    I'm running the command:

    peerflix "magner_uri..." -a --vlc
    

    and getting the error:

    node:internal/validators:216
        throw new ERR_SOCKET_BAD_PORT(name, port, allowZero);
        ^
    
    RangeError [ERR_SOCKET_BAD_PORT]: Port should be > 0 and < 65536. Received 69692710.
        at new NodeError (node:internal/errors:371:5)
        at validatePort (node:internal/validators:216:11)
        at Socket.send (node:dgram:629:12)
        at send (/opt/homebrew/lib/node_modules/peerflix/node_modules/bittorrent-tracker/lib/client/udp-tracker.js:186:12)
        at UDPTracker._request (/opt/homebrew/lib/node_modules/peerflix/node_modules/bittorrent-tracker/lib/client/udp-tracker.js:92:3)
        at UDPTracker.announce (/opt/homebrew/lib/node_modules/peerflix/node_modules/bittorrent-tracker/lib/client/udp-tracker.js:38:8)
        at /opt/homebrew/lib/node_modules/peerflix/node_modules/bittorrent-tracker/client.js:230:13
        at Array.forEach (<anonymous>)
        at Client._announce (/opt/homebrew/lib/node_modules/peerflix/node_modules/bittorrent-tracker/client.js:228:18)
        at Client.start (/opt/homebrew/lib/node_modules/peerflix/node_modules/bittorrent-tracker/client.js:166:8) {
      code: 'ERR_SOCKET_BAD_PORT'
    }
    
    Node.js v17.0.1
    

    Environment:

    • Arm Based M1-MacBook Air
    • Node v17.0.1
    • Shell: Fish

    Hope this helps, I'm unable to debug the problem

    opened by Just-Moh-it 0
  • VLC is always on top

    VLC is always on top

    Love Peerflix! So good!

    One minor issue is that it seems to force VLC to be always on top, despite the setting being disabled in prefs. Is there a workaround this?

    I came up with a Keyboard Maestro macro that waits for the file size to be big enough to play and then manually opens the file in VLC. This stops VLC from being weird, but it would be great if this wasn't necessary.

    Thanks!

    opened by noisyneil 4
  • Request: Add path for VLC Flatpak

    Request: Add path for VLC Flatpak

    Can peerflix add support for VLC flatpak? Or can someone tell me how I can alter existing code to make peerflix check for VLC flatpak when using the --vlc flag?

    opened by chaibronz 0
  • No audio

    No audio

    When i try to reproduce a movie from peerflix the sound of the movie is unreal.

    I'm using mpv like media player.

    sudo peerflix "magnet:?xt=urn:btih:AC3B06A392EDD155A77DD39F302A056D0CD6E51B&dn=Ex.Machina.2015.720p.BluRay.x264.LLG&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=UDP%3A%2F%2FTRACKER.LEECHERS-PARADISE.ORG%3A6969%2FANNOUNCE&tr=udp%3A%2F%2Ftracker.zer0day.to%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fcoppersurfer.tk%3A6969%2Fannounce" --mpv

    Linux 5.10.0-10-amd64 #1 SMP Debian 5.10.84-1 (2021-12-08) x86_64 GNU/Linux mpv 0.32.0

    opened by Villelmo 0
Owner
Mathias Buus
Rød grød med fløde
Mathias Buus
torrent-stream + chromecast

peercast torrent-stream + chromecast npm install -g peercast Usage Be on the same wifi as your chromecast and do peercast magnet:?xt=urn:btih:99feae0

Mathias Buus 503 Dec 15, 2022
🤖 GPU accelerated Neural networks in JavaScript for Browsers and Node.js

brain.js GPU accelerated Neural networks in JavaScript for Browsers and Node.js About brain.js is a GPU accelerated library for Neural Networks writte

brain.js 13.4k Jan 7, 2023
A JavaScript PDF generation library for Node and the browser

PDFKit A JavaScript PDF generation library for Node and the browser. Description PDFKit is a PDF document generation library for Node and the browser

null 8.5k Jan 2, 2023
Lightweight operating system using Node.js as userspace

NodeOS Lightweight operating system using Node.js as userspace. NodeOS is an operating system built entirely in Javascript and managed by npm. Any pac

NodeOS 6.8k Dec 30, 2022
A pure JavaScript implementation of git for node and browsers!

isomorphic-git isomorphic-git is a pure JavaScript reimplementation of git that works in both Node.js and browser JavaScript environments. It can read

isomorphic-git 6.7k Jan 4, 2023
A javascript Bitcoin library for node.js and browsers.

BitcoinJS (bitcoinjs-lib) A javascript Bitcoin library for node.js and browsers. Written in TypeScript, but committing the JS files to verify. Release

bitcoinjs 4.8k Jan 1, 2023
Node module for creating dat compatible tools on file systems

dat-node dat-node is a high-level module for building Dat applications on the file system. For a lower-level API for building your own applications, u

Dat Project 507 Nov 18, 2022
⚡️ Streaming torrent client for the web

WebTorrent The streaming torrent client. For node.js and the web. Sponsored by WebTorrent is a streaming torrent client for node.js and the browser. Y

WebTorrent 27.4k Jan 4, 2023
Webrtc, & web socket based streaming live video streaming and chatting platform. Written in Node, Typescript, and Javascript!

Live Streaming!! Welcome to my implementation of live streaming along with real time chat. I'm going to make a live streaming platform that will supoo

Hamdaan Khalid 19 Nov 23, 2022
Pim 4 Jun 21, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
torrent-stream + chromecast

peercast torrent-stream + chromecast npm install -g peercast Usage Be on the same wifi as your chromecast and do peercast magnet:?xt=urn:btih:99feae0

Mathias Buus 503 Dec 15, 2022
Adds links to Discogs pages from various sites. Auto search for music on torrent and other sites. Does multi auto-search on Artist/Discography pages. Auto search local HDDs/filelists using Voidtools Everything search engine.

Discogs Scout: Adds links to Discogs pages from various sites. Auto search for music on torrent and other sites. Does multi auto-search on Artist/Disc

null 27 Dec 27, 2022
A JavaScript library for EASILY fetching info from TheMovieDB API with support for torrent file names.

TheMovieDB-API-Wrapper.js A easy to use, pure vanilla JavaScript API wrapper for TheMovieDB Show your support! A JavaScript library for easily fetchin

Marketing Pipeline 5 Dec 2, 2022
TikTokLive-Widget: A socket client/server program that exposes a widget with alerts (such as gifts, followers ...) for a specific user streaming on Tik Tok Live platform

TikTokLive-Widget: A socket client/server program that exposes a widget with alerts (such as gifts, followers ...) for a specific user streaming on Tik Tok Live platform

null 3 Dec 3, 2022
A transparent, in-memory, streaming write-on-update JavaScript database for Small Web applications that persists to a JavaScript transaction log.

JavaScript Database (JSDB) A zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to

Small Technology Foundation 237 Nov 13, 2022
make streaming http requests

hyperquest treat http requests as a streaming transport The hyperquest api is a subset of request. This module works in the browser with browserify. r

James Halliday 711 Sep 8, 2022