Giter Site home page Giter Site logo

fairtoys / webtorrent-cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from webtorrent/webtorrent-cli

0.0 1.0 0.0 503 KB

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

Home Page: https://webtorrent.io

License: MIT License

JavaScript 98.46% Shell 1.54%

webtorrent-cli's Introduction


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        DNLA                                                                   [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.

webtorrent-cli's People

Contributors

allanlw avatar alxhotel avatar astro avatar cagriulas avatar cybershadow avatar diegorbaquero avatar fabiospampinato avatar feross avatar gillesdemey avatar greenkeeper[bot] avatar grunjol avatar iovis avatar jashandeep-sohi avatar josephfrazier avatar ksnikiforov avatar neo2shyalien avatar osmanaltun avatar pandres95 avatar renovate-bot avatar renovate[bot] avatar rom1504 avatar semantic-release-bot avatar silentbot1 avatar sindresorhus avatar sitebase avatar solderzzc avatar transitive-bullshit avatar utlime avatar valeriangalliat avatar vrde avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.