Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeding doesn't work properly in node.js #1274

Closed
aszokalski opened this issue Jan 24, 2018 · 1 comment
Closed

Seeding doesn't work properly in node.js #1274

aszokalski opened this issue Jan 24, 2018 · 1 comment

Comments

@aszokalski
Copy link

@aszokalski aszokalski commented Jan 24, 2018

version: v0.98.20

MacOS X high sierra Node.js v8.9.4

I wanted to seed a torrent and be able to download it from other computer.

The magnet that the seed function returned didn't work on uTorrent or instant.io and was returning this error: Invalid torrent identifier. When I deleted all the trackers and other info leaving only xt, instant.io started processing but it was taking so long that after 30 mins it didn't download a 100kb file. (I don't know if it was even downloading). I know that instant.io works because i tested it on normal torrents so there must be an error in my code:

var WebTorrent, client, download, file_location, seed;

WebTorrent = require('webtorrent');

file_location = 'node/files/';

client = new WebTorrent();

download = function(magnet) {
  return client.add(magnet, {
    path: 'node/files/'
  }, function(torrent) {
    return torrent.on('done', function() {
      return console.log('torrent download finished');
    });
  });
};

seed = function(file) {
  return client.seed(file, function(torrent) {
    return console.log('Client is seeding ' + torrent.magnetURI);
  });
};

seed(file_location+'README.md');
@aszokalski

This comment has been minimized.

Copy link
Author

@aszokalski aszokalski commented Jan 24, 2018

there are so many returns because I use coffeescript and it compiles like this.

@aszokalski aszokalski closed this Jan 26, 2018
@lock lock bot locked as resolved and limited conversation to collaborators May 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.