Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
scrape-torrent-stats
Advanced tools
Scrape information from the bittorrent trackers and the distributed hash table. Given a bittorrent magnet URI, scrapeTorrentStats can check both tracker and the DHT for downloads and peers.
Scrape information from the bittorrent trackers and the distributed hash table.
Given a bittorrent magnet URI, scrapeTorrentStats can check both tracker and the DHT for downloads and peers.
This project uses two great projects from the wizards that brought us WebTorrent. We use their DHT client bittorrent-dht, and their tracker client bittorrent-tracker.
This project uses native promises.
By running this code you are connecting to users and systems that are sharing whatever file(s) you are requesting. For free legally distributed content this is not an issue. For copyrighted content, this code base does NOT download any portion of the requested files. This means this software only attempts to discover peers and does not in any way initiate or support downloading or uploading of any files. This does not mean you will not show up on another system for having connected to or requested information from a system holding the requested content.
Run this at your own risk.
lets install the component
yarn add scrape-torrent-stats
We have 3 ways to interact with this library. The Discovery function allows access to both DHT and Tracker scrapes. The other two ways are functions used to specifically to get data from DHT or trackers: getDHTData and getTrackerData. For more information and examples see our examples folder.
This example is for scraping DHT sources for a torrent. The discover
function takes two arguments, both are required!. The first is a magnet URI as a string. The second argument is a configuration object. The configuration object MUST include a source
key. The source key can have one of three values: 'both'
, 'dht'
or 'tracker'
. The configuration object has an optional waitTime
key that can be set how long to check for peers. You can also enable verbose console logging of the service by setting verbose
key to true
inside of the configuration object. By default verbose
is set to false.
const { discover } = require('scrape-torrent-stats')
// ubuntu desktop magnet uri
const uri =
'magnet:?xt=urn:btih:f07e0b0584745b7bcb35e98097488d34e68623d0&dn=ubuntu-17.10.1-desktop-amd64.iso'
const config = {
source: 'dht',
waitTime: 10000 // 10 second wait before closing peer search
}
discover(uri, config)
.then(result => {
console.log(result)
// Structure of result object can be seen further down
})
.catch(err => {
console.error(err)
})
The result
object returned above is structured as:
{
peersObj: {},
fromsObj: {}
}
The peersObj
is an object full of peers. The keys for peersObj
are a series of strings consisting of a peer's host:port. The value for the key is:
{
host: '69.197.183.44',
port: 39639
}
The fromsObj
is an object full of peer sources. The keys for fromsObj
are a series of strings consisting of a peer source's address:port. The value for the key is:
{
address: '163.172.57.150',
family: 'IPv4',
port: 6881,
size: 339
}
When using the Discover you can also enable verbose logging. For example:
const { discover } = require('scrape-torrent-stats')
// ubuntu desktop magnet uri
const uri =
'magnet:?xt=urn:btih:f07e0b0584745b7bcb35e98097488d34e68623d0&dn=ubuntu-17.10.1-desktop-amd64.iso'
const config = {
source: 'dht',
waitTime: 10000, // 10 second wait before closing peer search
verbose: true,
}
discover(uri, config)
FAQs
Scrape information from the bittorrent trackers and the distributed hash table. Given a bittorrent magnet URI, scrapeTorrentStats can check both tracker and the DHT for downloads and peers.
The npm package scrape-torrent-stats receives a total of 0 weekly downloads. As such, scrape-torrent-stats popularity was classified as not popular.
We found that scrape-torrent-stats demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.