diff options
author | fisch0920 <fisch0920@gmail.com> | 2014-05-16 12:43:18 +0400 |
---|---|---|
committer | fisch0920 <fisch0920@gmail.com> | 2014-05-16 12:43:18 +0400 |
commit | da72f6bbe213f98575e1bf01f6cd17ee331bcf53 (patch) | |
tree | ac66940f4ddb11fa38d5427a79f3209f4f12a761 /index.js | |
parent | 1529dcff555bba3abe9a67e93d030548fdb8863f (diff) |
adding FSStorage; webtorrent now can save the results of a torrent download to the filesystem
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -3,6 +3,7 @@ module.exports = WebTorrent var Client = require('bittorrent-client') +var FSStorage = require('./lib/fs_storage') var fs = require('fs') var url = require('url') var http = require('http') @@ -10,6 +11,7 @@ var inherits = require('inherits') var pump = require('pump') var mime = require('mime') var rangeParser = require('range-parser') +var extend = require('extend.js') inherits(WebTorrent, Client) @@ -43,6 +45,9 @@ WebTorrent.prototype.add = function (torrentId, opts, cb) { opts = {} } if (typeof cb !== 'function') cb = function () {} + opts = extend({ + storage: FSStorage + }, opts) self.index = opts.index |