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
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2015-05-24 19:07:40 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-05-24 19:07:40 +0300
commit880724050fef52fa8e5ab30338c01353ec47db97 (patch)
treec074bcffdc53fd99a95202616c024e3aae07ec95
parenta71b8b7d72031ee25caf47776c8c4b870f6d050c (diff)
command line: make "seed" command do the right thing
Fixes #328
-rwxr-xr-xbin/cmd.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index 44859cd..b05830b 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -429,6 +429,14 @@ function runDownload (torrentId) {
}
function runSeed (input) {
+ if (path.extname(input) === '.torrent' || /^magnet:/.test(input)) {
+ // `webtorrent seed` is meant for creating a new torrent based on a file or folder
+ // of content, not a torrent id (.torrent or a magnet uri). If this command is used
+ // incorrectly, let's just do the right thing.
+ runDownload(input)
+ return
+ }
+
var client = new WebTorrent({
blocklist: argv.blocklist
})