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

webtorrent resolve but do not download - FR #1181

Closed
sibiraj-s opened this issue Aug 30, 2017 · 8 comments
Closed

webtorrent resolve but do not download - FR #1181

sibiraj-s opened this issue Aug 30, 2017 · 8 comments

Comments

@sibiraj-s
Copy link

@sibiraj-s sibiraj-s commented Aug 30, 2017

What version of WebTorrent? 0.98.19

What operating system and Node.js version? Windows, Node 8+

What did you expect to happen?

var client = new WebTorrent();
client.resolve(torrentId, function (torrent) {
       console.log(torrent); // torrent information but don't download
});

What actually happened?
this starts downloading file automatically

var client = new WebTorrent();
client.add(torrentId, function (torrent) {
     /* ... */
});

is there any method available to get torrent information including

torrent.torrentFile
torrent.torrentFileBlobURL

feature to not start downloading files automatically will be nice. or am I missing something

@DiegoRBaquero

This comment has been minimized.

Copy link
Member

@DiegoRBaquero DiegoRBaquero commented Aug 31, 2017

The only thing that you could get without actually downloading any data is the metadata of the torrent. Not the files, not the blob url.

resolve is not in the API, so this is not a bug, is a feature request.

@sibiraj-s

This comment has been minimized.

Copy link
Author

@sibiraj-s sibiraj-s commented Aug 31, 2017

Yes @DiegoRBaquero, that was a feature request. I am not referring that as a bug

As a workaround to get torrent files I am doing this

var torrentInfo;

var newClient = client.add(torrentId, function (torrent) {
     torrentInfo = torrent;  // save torrent info
});

client.on('torrent', function () {
     newClient.destroy(); // once I get the information. 
     // I am destroying the client to stop download
});
@sibiraj-s sibiraj-s changed the title webtorrent resolve but do not download webtorrent resolve but do not download - FR Aug 31, 2017
@sibiraj-s

This comment has been minimized.

Copy link
Author

@sibiraj-s sibiraj-s commented Nov 2, 2017

@DiegoRBaquero Any updates on this FR?

@DiegoRBaquero

This comment has been minimized.

Copy link
Member

@DiegoRBaquero DiegoRBaquero commented Nov 2, 2017

@sibiraj-s

This comment has been minimized.

Copy link
Author

@sibiraj-s sibiraj-s commented Nov 3, 2017

it will be nice to know what are the files that we are going to download. before start downloading. also, we can save that as a .torrent file

@DiegoRBaquero

This comment has been minimized.

Copy link
Member

@DiegoRBaquero DiegoRBaquero commented Nov 3, 2017

@sibiraj-s

This comment has been minimized.

Copy link
Author

@sibiraj-s sibiraj-s commented Nov 3, 2017

yeah, I have been doing that. But that is a cool feature to have. isn't it

@DiegoRBaquero

This comment has been minimized.

Copy link
Member

@DiegoRBaquero DiegoRBaquero commented Nov 3, 2017

It'd be best to have it as another module built on top of the core lib. Feel free to publish your code as a standalone npm module. I'm gonna leave this open for anyone (or you) who wants to build it :)

@sibiraj-s sibiraj-s closed this Jan 19, 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
2 participants
You can’t perform that action at this time.