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

WT can't handle magnets from private trackers, only torrent files #511

Closed
tsoernes opened this issue Dec 3, 2015 · 6 comments
Closed

WT can't handle magnets from private trackers, only torrent files #511

tsoernes opened this issue Dec 3, 2015 · 6 comments

Comments

@tsoernes
Copy link

@tsoernes tsoernes commented Dec 3, 2015

If I use WebTorrent in the command line, and pass it the location of a downloaded .torrent file from a private tracker, it functions as expected.

If I pass the same torrent file through parse-torrent to get the magnet URI and then pass this magnet to WebTorrent in the cli, it does not find any peers.

E.g.

webtorrent "C:\Path\to\file.torrent"

works, but the output from

var parsed = pt(fs.readFileSync('C:\\path\to\file.torrent'))
var uri = parsetorrent.toMagnetURI(parsed)

does not work when passed to the WebTorrent CLI. I can't upload the torrent file here, as it contains the login token for the private tracker, but I can send it by email if you need it.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Dec 4, 2015

There's probably a custom field in the .torrent file that the tracker server needs and parse-torrent doesn't recognize it so it throws it away.

Can you run the following code on the torrent file?

var path = 'path/to/file.torrent'
console.log(Object.keys(bencode.decode(fs.readFileSync(path))))
console.log(Object.keys(bencode.decode(fs.readFileSync(path)).info))

You will need to install this package:

npm install bencode

Then paste the output here.

@tsoernes

This comment has been minimized.

Copy link
Author

@tsoernes tsoernes commented Dec 4, 2015

Result:
[ 'announce', 'created by', 'creation date', 'info' ]
[ 'files', 'name', 'piece length', 'pieces', 'private', 'source' ]

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Dec 4, 2015

parse-torrent doesn't recognize the "source" key. I wonder if there's documentation for that anywhere? I've never seen that in any spec.

Do you have a parallel magnet link for the torrent file you're using, from the same source? Could you run this on it?

var magnet = require('magnet-uri')
var uri = 'magnet:?xt...'
console.log(Object.keys(magnet(uri)))

You'll need to install this package first:

npm install magnet-uri
@tsoernes

This comment has been minimized.

Copy link
Author

@tsoernes tsoernes commented Dec 4, 2015

No, sorry, the tracker does not specify magnets

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Dec 4, 2015

My understanding of the way that "private torrents" work is that they just use an http tracker server and put a unique identifier into the announce url (for example: a query param). There's no reason this shouldn't work fine as a magnet uri. The tracker will still be contacted, as before.

The only reason I can think of why this isn't working is that other torrent clients that are using the private .torrent file (with the "private: 1" flag) have disabled the ut_metadata extension, so you're not able to fetch the torrent metadata from them.

In any case, I think WebTorrent is producing the correct magnet uri here, so there's nothing else to do.

@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 5, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

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