All Projects → alxhotel → webtorrent-health

alxhotel / webtorrent-health

Licence: MIT license
💚 Get health info about a webtorrent file or magnet link

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to webtorrent-health

Torrenter
Simple nodejs package to download torrents using torrent-indexer and webtorrent, especially movie and series.
Stars: ✭ 42 (+55.56%)
Mutual labels:  tracker, torrent, webtorrent
Wt Tracker
High-performance WebTorrent tracker
Stars: ✭ 144 (+433.33%)
Mutual labels:  tracker, torrent, webtorrent
Bittorrent Tracker
🌊 Simple, robust, BitTorrent tracker (client & server) implementation
Stars: ✭ 1,184 (+4285.19%)
Mutual labels:  tracker, torrent, webtorrent
Torrent Discovery
Discover BitTorrent and WebTorrent peers
Stars: ✭ 177 (+555.56%)
Mutual labels:  tracker, torrent, webtorrent
Nyaa
Bittorrent software for cats
Stars: ✭ 2,899 (+10637.04%)
Mutual labels:  tracker, torrent
Trackerslistcollection
🎈 Updated daily! A list of popular BitTorrent Trackers! / 每天更新!全网热门 BT Tracker 列表!
Stars: ✭ 9,761 (+36051.85%)
Mutual labels:  tracker, torrent
ut pex
Implementation of ut_pex bittorrent protocol (PEX) for webtorrent
Stars: ✭ 54 (+100%)
Mutual labels:  torrent, webtorrent
Unit3d Community Edition
🚀 A Next Generation Private Torrent Tracker (Community Edition)
Stars: ✭ 1,305 (+4733.33%)
Mutual labels:  tracker, torrent
Snail
基于Java、JavaFX开发的下载工具,支持下载协议:BT(BitTorrent、磁力链接、种子文件)、HLS(M3U8)、FTP、HTTP。人家才不要你的⭐⭐呢,哼
Stars: ✭ 102 (+277.78%)
Mutual labels:  tracker, torrent
Udpt
A lightweight UDP torrent tracker
Stars: ✭ 143 (+429.63%)
Mutual labels:  tracker, torrent
CheckWebPeer
Check WebRTC peers of torrents.
Stars: ✭ 19 (-29.63%)
Mutual labels:  torrent, webtorrent
Animetrackerlist
动漫磁性链接加速方案(animeTrackerList)
Stars: ✭ 572 (+2018.52%)
Mutual labels:  tracker, torrent
Torrent
Full-featured BitTorrent client package and utilities
Stars: ✭ 4,138 (+15225.93%)
Mutual labels:  tracker, torrent
Ipmagnet
Check which IP adresses your BitTorrent client is handing out to trackers
Stars: ✭ 200 (+640.74%)
Mutual labels:  tracker, torrent
uWebTorrentTracker
🔆 Simple, robust, WebTorrent tracker server implementation
Stars: ✭ 58 (+114.81%)
Mutual labels:  tracker, webtorrent
Covid-19-Tracker
This is an Covid-19 tracker especially made for India
Stars: ✭ 39 (+44.44%)
Mutual labels:  tracker, health
UNIT3D-INSTALLER
Provisioner and Installer for the UNIT3D Torrent Tracker Platform.
Stars: ✭ 43 (+59.26%)
Mutual labels:  tracker, torrent
torrent
Bittorrent library implemented in pure Dart. [WIP, early development stage]
Stars: ✭ 26 (-3.7%)
Mutual labels:  tracker, torrent
torrent-indexer
Yet another node.js torrent scraper made especially for movie, series, anime and music (scrape from 1337x, eztv, limetorrents, rarbg, skytorrents, thepiratebay, torrentproject, yts and zooqle)
Stars: ✭ 50 (+85.19%)
Mutual labels:  tracker, torrent
SpooferBT
Relay torrent tracker communication via TCP to bypass a blocked UDP network.
Stars: ✭ 18 (-33.33%)
Mutual labels:  tracker, torrent

webtorrent-health

NPM Version Build Status Dependency Status Standard - Javascript Style Guide

Get health info about a webtorrent file or magnet link

Install

npm install webtorrent-health

Usage

The param torrentId can be a webtorrent file or magnet link, for more info check out parse-torrent.

webtorrentHealth(torrentId [, opts], callback)
var webtorrentHealth = require('webtorrent-health')
var magnet = 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d&dn=sintel.mp4&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com'

webtorrentHealth(magnet, function (err, data) {
  if (err) return console.error(err)

  console.log('average number of seeders: ' + data.seeds)
  console.log('average number of leechers: ' + data.peers)
  console.log('ratio: ', +(Math.round((data.peers > 0 ? data.seeds / data.peers : data.seeds) +'e+2') + 'e-2'))
})

You can also use Promises/A+:

var webtorrentHealth = require('webtorrent-health')
var magnet = 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d&dn=sintel.mp4&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com'

webtorrentHealth(magnet).then(function (data) {
  console.log('average number of seeders: ' + data.seeds)
  console.log('average number of leechers: ' + data.peers)
  console.log('ratio: ', +(Math.round((data.peers > 0 ? data.seeds / data.peers : data.seeds) +'e+2') + 'e-2'))
}).catch(console.error.bind(console))

If you couldn't scrape any of the trackers you will not get any errors, but the returned data will look like this:

{
  seeds: 0,
  peers: 0,
  extra: [...]
}

The attribute extra is an Array of Objects, that contains more info about the each tracker. Example:

[
  {
    tracker: 'wss://tracker.openwebtorrent.com',
    seeds: 561,
    peers: 12967,
    downloads: 561,
    response_time: 229
  },
  {
    tracker: 'wss://tracker.btorrent.xyz',
    seeds: 601,
    peers: 19119,
    downloads: 601,
    response_time: 705
  },
  {
    tracker: 'wss://tracker.badtracker.com',
    error: 'connection error to wss://tracker.badtracker.com'
  }
]

Additional params

  • opts.trackers: additional trackers to scrape on top of the ones torrentId has.
    • Type: an Array of Strings
    • Example:
webtorrentHealth(torrentId, {
    trackers: ['wss://tracker.openwebtorrent.com']
}, function (err, data) {
  // Do something
})
  • opts.blacklist: don't scrape some trackers.
    • Type: an Array of Strings (each string can be a regex)
    • Example:
webtorrentHealth(torrentId, {
    blacklist: [
        'openbittorrent'    // will blacklist any tracker containing that string in its URI
    ]
}, function (err, data) {
  // Do something
})
  • opts.timeout: timeout in milliseconds for each request to scarpe the tracker. Default is 1000.
    • Type: number
    • Example:
webtorrentHealth(torrentId, {
    timeout: 1500
}, function (err, data) {
  // Do something
})

License

MIT. Copyright (c) Alex

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].