• Stars
    star
    1,154
  • Rank 40,425 (Top 0.8 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 9 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

WebTorrent, the streaming torrent client. For the command line.


WebTorrent
WebTorrent CLI

The streaming torrent client. For the command line.

ci npm version npm downloads javascript style guide


WebTorrent is the first BitTorrent client that works in the browser, but webtorrent-cli, i.e. THIS PACKAGE, is for using WebTorrent from the command line.

webtorrent-cli is a simple torrent client for use in node.js, as a command line app. It uses TCP and UDP to talk to other torrent clients.

NOTE: To connect to "web peers" (browsers) in addition to normal BitTorrent peers, use webtorrent-hybrid which includes WebRTC support for node.

To use WebTorrent in the browser, see webtorrent.

Features

  • Use WebTorrent from the command line!
  • Insanely fast
  • Pure Javascript (no native dependencies)
  • Streaming
    • Stream to AirPlay, Chromecast, VLC player, IINA, and many other devices/players
    • Fetches pieces from the network on-demand so seeking is supported (even before torrent is finished)
    • Seamlessly switches between sequential and rarest-first piece selection strategy
  • Supports advanced torrent client features

Install

To install a webtorrent command line program, run:

npm install webtorrent-cli -g

Usage

$ webtorrent --help
               _     _                            _
 __      _____| |__ | |_ ___  _ __ _ __ ___ _ __ | |_
 \ \ /\ / / _ \ '_ \| __/ _ \| '__| '__/ _ \ '_ \| __|
  \ V  V /  __/ |_) | || (_) | |  | | |  __/ | | | |_
   \_/\_/ \___|_.__/ \__\___/|_|  |_|  \___|_| |_|\__|

Usage:
  webtorrent [command] <torrent-id> [options]

Examples:
  webtorrent download "magnet:..." --vlc
  webtorrent "magnet:..." --vlc --player-args="--video-on-top --repeat"

Default output location:
  * when streaming: Temp folder
  * when downloading: Current directory

Specify <torrent-id> as one of:
  * magnet uri
  * http url to .torrent file
  * filesystem path to .torrent file
  * info hash (hex string)

Commands:
  webtorrent download [torrent-ids...]      Download a torrent                             [default]
  webtorrent downloadmeta <torrent-ids...>  Download metadata of torrent
  webtorrent seed <inputs...>               Seed a file or a folder
  webtorrent create <input>                 Create a .torrent file
  webtorrent info <torrent-id>              Show torrent information
  webtorrent version                        Show version information
  webtorrent help                           Show help information

Options (streaming):
      --airplay     Apple TV                                                               [boolean]
      --chromecast  Google Chromecast                                                 [default: all]
      --dlna        DLNA                                                                   [boolean]
      --mplayer     MPlayer                                                                [boolean]
      --mpv         MPV                                                                    [boolean]
      --omx         OMX                                                              [default: hdmi]
      --vlc         VLC                                                                    [boolean]
      --iina        IINA                                                                   [boolean]
      --smplayer    SMPlayer                                                               [boolean]
      --xbmc        XBMC                                                                   [boolean]
      --stdout      Standard out (implies --quiet)                                         [boolean]

Options (simple):
  -o, --out        Set download destination                                                 [string]
  -s, --select     Select specific file in torrent                             [default: List files]
  -t, --subtitles  Load subtitles file                                                      [string]
  -h, --help       Show help information                                                   [boolean]
  -v, --version    Show version information                                                [boolean]

Options (advanced)
  -p, --port            Change the http server port                         [number] [default: 8000]
  -b, --blocklist       Load blocklist file/url                                             [string]
  -a, --announce        Tracker URL to announce to                                          [string]
  -q, --quiet           Don't show UI on stdout                                            [boolean]
  -d, --download-limit  Maximum download speed in kb/s                 [number] [default: unlimited]
  -u, --upload-limit    Maximum upload speed in kb/s                   [number] [default: unlimited]
      --pip             Enter Picture-in-Picture if supported by the player                [boolean]
      --verbose         Show torrent protocol details                                      [boolean]
      --playlist        Open files in a playlist if supported by the player                [boolean]
      --player-args     Add player specific arguments (see example)                         [string]
      --torrent-port    Change the torrent seeding port                   [number] [default: random]
      --dht-port        Change the dht port                               [number] [default: random]
      --not-on-top      Don't set "always on top" option in player                         [boolean]
      --keep-seeding    Don't quit when done downloading                                   [boolean]
      --no-quit         Don't quit when player exits                                       [boolean]
      --on-done         Run script after torrent download is done                           [string]
      --on-exit         Run script before program exit                                      [string]

To download a torrent:

$ webtorrent magnet_uri

To stream a torrent to a device like AirPlay or Chromecast, just pass a flag:

$ webtorrent magnet_uri --airplay

In addition to magnet uris, webtorrent supports many ways to specify a torrent:

  • magnet uri (string)
  • torrent file (buffer)
  • info hash (hex string or buffer)
  • parsed torrent (from parse-torrent)
  • http/https url to a torrent file (string)
  • filesystem path to a torrent file (string)

License

MIT. Copyright (c) Feross Aboukhadijeh and WebTorrent, LLC.

More Repositories

1

webtorrent

⚡️ Streaming torrent client for the web
JavaScript
29,385
star
2

webtorrent-desktop

❤️ Streaming torrent app for Mac, Windows, and Linux
JavaScript
9,659
star
3

instant.io

🚀 Streaming file transfer over WebTorrent (torrents on the web)
JavaScript
3,423
star
4

bittorrent-tracker

🌊 Simple, robust, BitTorrent tracker (client & server) implementation
JavaScript
1,744
star
5

bittorrent-dht

🕸 Simple, robust, BitTorrent DHT implementation
JavaScript
1,216
star
6

webtorrent-hybrid

WebTorrent (with WebRTC support in Node.js)
JavaScript
518
star
7

parse-torrent

Parse a torrent identifier (magnet uri, .torrent file, info hash)
JavaScript
438
star
8

create-torrent

Create .torrent files
JavaScript
342
star
9

bittorrent-protocol

Simple, robust, BitTorrent peer wire protocol implementation
JavaScript
342
star
10

magnet-uri

Parse a magnet URI and return an object of keys/values
JavaScript
221
star
11

torrent-discovery

Discover BitTorrent and WebTorrent peers
JavaScript
216
star
12

node-bencode

bencode de/encoder for nodejs
JavaScript
165
star
13

webtorrent.io

The code that runs the WebTorrent website
JavaScript
125
star
14

ut_metadata

BitTorrent Extension for Peers to Send Metadata Files (BEP 9)
JavaScript
110
star
15

bittorrent-peerid

Map a BitTorrent peer ID to a human-readable client name and version
JavaScript
65
star
16

parse-torrent-file

DEPRECATED: Parse a .torrent file and return an object of keys/values
JavaScript
63
star
17

ut_pex

Implementation of ut_pex bittorrent protocol (PEX) for webtorrent
JavaScript
58
star
18

workshop

Learn WebTorrent and WebRTC in a guided workshop!
48
star
19

bittorrent-lsd

Local Service Discovery (BEP14) implementation
JavaScript
35
star
20

fs-chunk-store

Filesystem (fs) chunk store that is abstract-chunk-store compliant
JavaScript
33
star
21

torrent-piece

Torrent piece abstraction
JavaScript
23
star
22

webtorrent-fixtures

Sample torrent files for the WebTorrent test suite
JavaScript
22
star
23

load-ip-set

download and parse ip-set (blocklist) files
JavaScript
22
star
24

lt_donthave

The BitTorrent lt_donthave extension (BEP 54)
JavaScript
11
star
25

addr-to-ip-port

Convert an "address:port" string to an array [address:string, port:number]
JavaScript
10
star
26

bep53-range

Parse and compose Magnet URI extension (BEP53) ranges
JavaScript
9
star
27

string2compact

Convert 'hostname:port' strings to BitTorrent's compact ip/host binary returned by Trackers
JavaScript
9
star
28

renovate-config

Renovate's config
1
star
29

semantic-release-config

JavaScript
1
star
30

.github

1
star