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

Option to add trackers to a certain torrent in WebTorrent #323

Closed
Qqwy opened this issue May 22, 2015 · 4 comments
Closed

Option to add trackers to a certain torrent in WebTorrent #323

Qqwy opened this issue May 22, 2015 · 4 comments

Comments

@Qqwy
Copy link

@Qqwy Qqwy commented May 22, 2015

I'm testing out WebTorrent, switching over from torrent-stream.
One thing I noticed is that WebTorrent does not seem to have a clear way to add trackers (beside the DHT-network of course) to a certain torrent. Is there a built-in mechanism for this?
If not, I think it would be a very useful feature that might very well speed up many of the torrent requests (at least the ones not needing WebRTC, for now).

@Svenskunganka

This comment has been minimized.

Copy link

@Svenskunganka Svenskunganka commented May 22, 2015

WebTorrent parses the magnet link or torrent file (which both contains the trackers) and adds the trackers to the torrent. See parse-torrent

@Qqwy

This comment has been minimized.

Copy link
Author

@Qqwy Qqwy commented May 22, 2015

So basically, if I want to add more trackers, I add them as '&tr=http://some.url.com&tr=http://some_other.url.com' to the end of the magnet string?

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented May 22, 2015

@Qqwy Correct - adding the additional trackers in the magnet uri would work.

You can also do:

var parseTorrent = require('parse-torrent')
var torrent = parseTorrent('magnet:...')

torrent.announce.push('another tracker')
client.add(torrent, function () { ... })
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented May 22, 2015

And, as of v0.43, you can also pass in an announce option to client.add, like this:

var WebTorrent = require('webtorrent')

var client = new WebTorrent()
client.add(torrentId, { announce: [] }, function () { ... })

This adds to the tracker list already specified in the torrentId. Cheers!

@feross feross closed this May 22, 2015
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 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
3 participants
You can’t perform that action at this time.