Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2015-12-27 17:02:30 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-12-27 17:02:30 +0300
commita06e102fdc715dd12944adfd8b5448b5e473274f (patch)
tree53a68cd22be1bd14be0a2d56e3d9b26b47bf8529 /bin
parent47f9551a01ac43fa1377eefe65e5428b1e9df14f (diff)
cmd: --announce flag works for "create" and "download" too
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cmd.js20
1 files changed, 7 insertions, 13 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index 2144b14..52a34a5 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -244,7 +244,7 @@ function runInfo (torrentId) {
}
function runCreate (input) {
- createTorrent(input, function (err, torrent) {
+ createTorrent(input, argv, function (err, torrent) {
if (err) return errorAndExit(err)
if (argv.out) {
fs.writeFileSync(argv.out, torrent)
@@ -261,12 +261,10 @@ function runDownload (torrentId) {
argv.out = process.cwd()
}
- client = new WebTorrent({
- blocklist: argv.blocklist
- })
- .on('error', fatalError)
+ client = new WebTorrent({ blocklist: argv.blocklist })
+ client.on('error', fatalError)
- var torrent = client.add(torrentId, { path: argv.out })
+ var torrent = client.add(torrentId, { path: argv.out, announce: argv.announce })
torrent.on('infoHash', function () {
function updateMetadata () {
@@ -471,14 +469,10 @@ function runSeed (input) {
return
}
- client = new WebTorrent({
- blocklist: argv.blocklist
- })
- .on('error', fatalError)
-
- client.seed(input, { announce: argv.announce })
+ client = new WebTorrent({ blocklist: argv.blocklist })
+ client.on('error', fatalError)
- client.on('torrent', function (torrent) {
+ client.seed(input, { announce: argv.announce }, function (torrent) {
if (argv.quiet) console.log(torrent.magnetURI)
drawTorrent(torrent)
})