DHT开源爬虫p2pspider.zip

时间:2022-08-05 00:22:55
【文件属性】:
文件名称:DHT开源爬虫p2pspider.zip
文件大小:258KB
文件格式:ZIP
更新时间:2022-08-05 00:22:55
开源项目 介绍      p2pspider 是一个 DHT 爬虫 BT 客户端的结合体, 从全球 DHT 网络里"嗅探"人们正在下载的资源, 并把资源的metadata(种子的主要信息)从远程 BT 客户端下载, 并生成资源磁力链接. 通过磁力链接, 你就可以下载到资源文件.用途你可以使用 p2pspider 打造私人种子库(比如: 海盗湾), 也可拿它做资源数据挖掘与分析。安装git clone https://github.com/Fuck-You-GFW/p2pspider使用使用前, 请确保你的 node 版本 >=0.12.0.'use strict';var P2PSpider = require('../lib');var p2p = P2PSpider({     nodesMaxSize: 200,   // be careful     maxConnections: 400, // be careful     timeout: 5000});p2p.ignore(function (infohash, rinfo, callback) {    // false => always to download the metadata even though the metadata is exists.     var theInfohashIsExistsInDatabase = false;    callback(theInfohashIsExistsInDatabase); });p2p.on('metadata', function (metadata) {    // At here, you can extract data and save into database.     console.log(metadata); });p2p.listen(6881, '0.0.0.0');目前只能放在有公网 IP 的主机上执行, 或者路由器设置端口转发(默认6881, UDP协议).贡献代码     fork 并拉取代码后,执行 npm install 安装依赖, 然后执行 node test/index.js 就可以看到测试效果。作者博客介绍:http://www.cnblogs.com/52web/p/5253697.html 标签:爬虫

网友评论