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

How can I get total number of downloads in a swarm. #1627

Closed
i-coderdev opened this issue May 13, 2019 · 1 comment
Closed

How can I get total number of downloads in a swarm. #1627

i-coderdev opened this issue May 13, 2019 · 1 comment
Labels

Comments

@i-coderdev
Copy link

@i-coderdev i-coderdev commented May 13, 2019

This is not a issues,

Anyone can tell me how can I get total number of downloads information from torrent infoHashes.

@SilentBot1 SilentBot1 added the question label Jul 21, 2019
@SilentBot1

This comment has been minimized.

Copy link
Member

@SilentBot1 SilentBot1 commented Jul 21, 2019

Hi @i-coderdev

To get this information you can use the following example code:

torrent.discovery.tracker.on('scrape', function (data) {
  console.log('got a scrape response from tracker: ' + data.announce)
  console.log('number of seeders in the swarm: ' + data.complete)
  console.log('number of leechers in the swarm: ' + data.incomplete)
  console.log('number of total downloads of this torrent: ' + data.downloaded)
})

torrent.discovery.tracker.scrape()

This will invoke the scrape function within bittorrent-tracker's client and return all metadata from the tracker. Alternatively you can use bittorrent-tracker standalone without having the overhead of the webtorrent library.

As this is a question, I'm going to close this issue but if you need any more help with this, feel free to continue the conversation in this ticket.

Kind regards
Brad

@SilentBot1 SilentBot1 closed this Jul 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.