Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring storage #200

Closed
gyzerok opened this issue Dec 5, 2014 · 5 comments
Closed

Configuring storage #200

gyzerok opened this issue Dec 5, 2014 · 5 comments

Comments

@gyzerok
Copy link

@gyzerok gyzerok commented Dec 5, 2014

Hi, guys!

Sorry for such a question, but I cant find answer in the documentation by myself.
How do I configure storage parameter to use filesystem? How to set up temp directory path for downloading content?

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Dec 7, 2014

If you're using the command line version of the app, use the --out or -o flag. You can get a full list of webtorrent options by running webtorrent --help:

               _     _                            _
 __      _____| |__ | |_ ___  _ __ _ __ ___ _ __ | |_
 \ \ /\ / / _ \ '_ \| __/ _ \| '__| '__/ _ \ '_ \| __|
  \ V  V /  __/ |_) | || (_) | |  | | |  __/ | | | |_
   \_/\_/ \___|_.__/ \__\___/|_|  |_|  \___|_| |_|\__|

  Usage:
      webtorrent <options> <torrent-uri>

      Download the torrent from:
          * magnet uri
          * http url to .torrent file
          * filesystem path to .torrent file
          * info hash (hex string)

  Streaming options:
      --airplay               Apple TV
      --chromecast            Chromecast
      --mplayer               MPlayer
      --mpv                   MPV
      --omx [jack]            omx [default: hdmi]
      --vlc                   VLC
      --xbmc                  XBMC
      --stdout                standard out (implies --quiet)

  Options:
      -o, --out [path]        set download destination [default: /tmp/webtorrent]
      -l, --list              list files in torrent (with indexes)
      -i, --index [index]     stream a particular file from torrent (by index)
      -p, --port [number]     change the http port [default: 8000]
      -b, --blocklist [path]  load blocklist file/http url
      -t, --subtitles [file]  load subtitles file
      -q, --quiet             don't show UI on stdout
      -v, --version           print the current version

  Please report bugs!  https://github.com/feross/webtorrent/issues
@gyzerok

This comment has been minimized.

Copy link
Author

@gyzerok gyzerok commented Dec 7, 2014

@feross, thank you for your time, but no. I need a description of how to configure storage programmatically because the following piece of documentation doesnt describe it enough.

{
dht: Boolean, // Whether or not to enable DHT (default=true)
maxPeers: Number, // Max number of peers to connect to per torrent (default=100)
nodeId: String|Buffer, // DHT protocol node ID (default=randomly generated)
peerId: String|Buffer, // Wire protocol peer ID (default=randomly generated)
storage: Function // custom storage engine, or false to use in-memory engine
tracker: Boolean, // Whether or not to enable trackers (default=true)
verify: Boolean // Verify previously stored data before starting (default=false)
}

I just want to swap peerflix in my software with your module :)

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Dec 8, 2014

You can pass the tmp option to client.add. Example:

var WebTorrent = require('webtorrent');

var client = new WebTorrent();
client.add(torrentId, { tmp: '/path/to/download/folder' });

Sorry that the option is currently undocumented. I think the option name will eventually change to out or path, at which point I'll add it to the docs.

@gyzerok

This comment has been minimized.

Copy link
Author

@gyzerok gyzerok commented Dec 8, 2014

@feross, as I assume since I pass this option webtorrent will use disc storage rather than memory. Am I right?

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Apr 11, 2015

Yep, you are right.

@feross feross closed this Apr 11, 2015
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.