Skip to content

Artoriun/torrent-monitor

Repository files navigation

トレントモニター

ピアからデータを取得し、トレントファイルを監視するように設計されたNode.jsアプリケーション。

概要

このアプリケーションはWebTorrentを使用してBitTorrentネットワークに接続し、トレントファイルを監視します。IPアドレス、トレントクライアント、共有ピースなど、ピアに関するデータを収集します。収集されたデータは、さらなる分析のためにMySQLデータベースに保存されます。日本にあるピアのみを監視しますが、世界中のピアを監視する能力があります。この位置設定はハードコードされており、torrent-monitor.jsGET /monitor/:torrent Express APIエンドポイントで変更できます。

機能

  • WebTorrentを使用してBitTorrentネットワークに接続
  • 指定されたトレントファイルを監視
  • IPアドレスやトレントクライアントなど、ピアに関するデータを収集
  • 収集したデータをMySQLデータベースに保存
  • ピアのチェック、監視の停止、テーブルの削除のためのAPIエンドポイントを提供
  • データベース内の特定のピアの検索をサポート

インストール

  1. リポジトリをクローンします:
git clone https://github.com/Artoriun/torrent-monitor.git
  1. 依存関係をインストールします:
npm install
  1. MySQLデータベースをセットアップし、torrent-database.jsの接続詳細を更新します。

  2. アプリケーションを起動します:

node torrent-monitor.js

使用方法

アプリケーションを操作するには、以下のExpressエンドポイントを使用します。デフォルトでは、Expressサーバーはlocalhost:3000にあります。

  1. トレントの監視を開始: GET /monitor/:torrent :torrentを監視したいトレントのマグネットリンクまたはハッシュに置き換えます。

  2. 監視中のトレントのピアをチェック: GET /check/:torrent :torrentを監視中のトレントのハッシュに置き換えます。

  3. トレントの監視を停止: GET /stopMonitoring/:torrent :torrentを監視中のトレントのハッシュに置き換えます。

  4. トレントのデータベーステーブルを削除: GET /drop/:torrent :torrentを監視中のトレントのハッシュに置き換えます。

  5. ピアを検索: GET /:search/:torrent :searchを検索語に、:torrentを監視中のトレントのハッシュに置き換えます。

API ドキュメンテーション

詳細なAPIドキュメンテーションについては、右側のサイドメニューとtorrent-monitor.jsおよびtorrent-database.jsファイル内のコメントを参照してください。

謝辞


Torrent Monitor

A Node.js application designed to monitor torrent files and obtain data from peers.

Overview

This application uses WebTorrent to connect to the BitTorrent network and monitor torrent files. It collects data about peers, including their IP addresses, torrent clients, and shared pieces. The collected data is stored in a MySQL database for further analysis. It monitors only peers located in Japan but it is capable of monitoring peers worldwide. This location setting is hardcoded and can be changed, see the GET /monitor/:torrent Express API endpoint in torrent-monitor.js.

Features

  • Connects to the BitTorrent network using WebTorrent
  • Monitors specified torrent files
  • Collects data about peers, including IP addresses and torrent clients
  • Stores collected data in a MySQL database
  • Provides API endpoints for checking peers, stopping monitoring, and dropping tables
  • Supports searching for specific peers in the database

Installation

  1. Clone the repository:
git clone https://github.com/Artoriun/torrent-monitor.git
  1. Install dependencies:
npm install
  1. Set up a MySQL database and update the connection details in torrent-database.js.

  2. Start the application:

node torrent-monitor.js

Usage

Use the following Express endpoints to operate the application. By the default the Express server is located at localhost:3000.

  1. Start monitoring a torrent: GET /monitor/:torrent

    Replace :torrent with the magnet link or hash of the torrent you want to monitor.

  2. Check peers for a monitored torrent: GET /check/:torrent

    Replace :torrent with the hash of the monitored torrent.

  3. Stop monitoring a torrent: GET /stopMonitoring/:torrent

    Replace :torrent with the hash of the monitored torrent.

  4. Drop the database table for a torrent: GET /drop/:torrent

    Replace :torrent with the hash of the monitored torrent.

  5. Search for peers: GET /:search/:torrent

    Replace :search with a search term and :torrent with the hash of the monitored torrent.

API Documentation

For detailed API documentation, please refer to the side menu on the right and to the comments in the torrent-monitor.js and torrent-database.js files.

Acknowledgments

About

A torrent monitoring application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published