Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dht-infohash-crawler

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dht-infohash-crawler

DHT Infohash Crawler

  • 0.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by166.67%
Maintainers
1
Weekly downloads
 
Created
Source

dht-infohash-crawler

Crawl the DHT network for resource infohashes

This module partially implements BEP-5 to listen on DHT network for infohashes. It's based on dontcontactme's nodeDHT. The example code shows how to create multipul crawler instances to boost the crawling speed. After getting infohashes from DHT network peers, bep9-metadata-dl can be used to fetch the metadata.

Features

  • Simple API
  • Find peers from the DHT network
  • Node.js event emitter based interface

Install

npm install dht-infohash-crawler

API

createCrawler(opts)

crawler.on('infohash', callbackFn(infohash, peerId, peerAddress) {})

Options are:

{ 
  address: '0.0.0.0',     // Listening address, (default='0.0.0.0') 
  port: 6881,             // Listening port (default=6881)
  kbucketSize: 128,       // Size of kbucket (default=128)
  name: 'crawler'         // Crawler name (default='crawler')
}

Example:

const createCrawler = require('dht-infohash-crawler');

const crawler = createCrawler();
crawler.on('infohash', (infohash, peerId, peerAddress) => {
  console.log(`magnet:?xt=urn:btih:${infohash} peerId: ${peerId} ` + 
    `from ${peerAddress.address}:${peerAddress.port}`);
  }
);

License

MIT © Hong Yan.

Keywords

FAQs

Package last updated on 17 Dec 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc