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:
Diffstat (limited to 'bin/cmd.js')
-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
})