diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | examples/browser-download.js | 3 | ||||
-rw-r--r-- | examples/node-save-to-file-system.js | 4 | ||||
-rw-r--r-- | test/cmd.js | 4 | ||||
-rw-r--r-- | test/rarity-map.js | 2 |
5 files changed, 7 insertions, 8 deletions
@@ -147,7 +147,7 @@ var client = new WebTorrent() // When user drops files on the browser, create a new torrent and start seeding it! dragDrop('body', function (files) { - client.seed(files, function onTorrent (torrent) { + client.seed(files, function (torrent) { console.log('Client is seeding:', torrent.infoHash) }) }) diff --git a/examples/browser-download.js b/examples/browser-download.js index 18e1bbe..42c8789 100644 --- a/examples/browser-download.js +++ b/examples/browser-download.js @@ -2,8 +2,7 @@ var WebTorrent = require('webtorrent') var client = new WebTorrent() -// Go to https://instant.io, seed a file and use the magnet uri generated -var magnetUri = 'magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36' +var torrentId = 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d' client.add(magnetUri, function (torrent) { // Got torrent metadata! diff --git a/examples/node-save-to-file-system.js b/examples/node-save-to-file-system.js index 1d5e7e6..a2b1974 100644 --- a/examples/node-save-to-file-system.js +++ b/examples/node-save-to-file-system.js @@ -2,11 +2,11 @@ var WebTorrent = require('webtorrent') var fs = require('fs') var client = new WebTorrent() -var magnetUri = 'magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36' +var magnetUri = 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d' client.download(magnetUri, function (torrent) { // Got torrent metadata! - console.log('Torrent info hash:', torrent.infoHash) + console.log('Torrent magnet link:', torrent.magnetURI) torrent.files.forEach(function (file) { // Stream each file to the disk diff --git a/test/cmd.js b/test/cmd.js index 461b54d..59f0f56 100644 --- a/test/cmd.js +++ b/test/cmd.js @@ -70,7 +70,7 @@ test('Command line: webtorrent info /path/to/file.torrent', function (t) { test('Command line: webtorrent info magnet_uri', function (t) { t.plan(2) - var leavesMagnetURI = 'magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36&dn=Leaves+of+Grass+by+Walt+Whitman.epub&tr=http%3A%2F%2Ftracker.bittorrent.am%2Fannounce&tr=http%3A%2F%2Ftracker.thepiratebay.org%2Fannounce&tr=udp%3A%2F%2Ffr33domtracker.h33t.com%3A3310%2Fannounce&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80' + var leavesMagnetURI = 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d&dn=Leaves+of+Grass+by+Walt+Whitman.epub&tr=http%3A%2F%2Ftracker.bittorrent.am%2Fannounce&tr=http%3A%2F%2Ftracker.thepiratebay.org%2Fannounce&tr=udp%3A%2F%2Ffr33domtracker.h33t.com%3A3310%2Fannounce&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80' cp.exec(CMD + ' info "' + leavesMagnetURI + '"', function (err, data) { t.error(err) @@ -95,7 +95,7 @@ test('Command line: webtorrent create /path/to/file', function (t) { child.stdout.on('end', function () { var buf = Buffer.concat(chunks) var parsedTorrent = parseTorrent(new Buffer(buf, 'binary')) - t.deepEqual(parsedTorrent.infoHash, 'd2474e86c95b19b8bcfdb92bc12c9d44667cfa36') + t.deepEqual(parsedTorrent.infoHash, '6a9759bffd5c0af65319979fb7832189f4f3c35d') }) }) diff --git a/test/rarity-map.js b/test/rarity-map.js index f906120..07ec9a9 100644 --- a/test/rarity-map.js +++ b/test/rarity-map.js @@ -5,7 +5,7 @@ var RarityMap = require('../lib/rarity-map') var Swarm = require('bittorrent-swarm') var test = require('tape') -var infoHash = 'd2474e86c95b19b8bcfdb92bc12c9d44667cfa36' +var infoHash = '6a9759bffd5c0af65319979fb7832189f4f3c35d' var peerId1 = '-WW0001-' + hat(48) test('Rarity map usage', function (t) { |