ピアからデータを取得し、トレントファイルを監視するように設計されたNode.jsアプリケーション。
このアプリケーションはWebTorrentを使用してBitTorrentネットワークに接続し、トレントファイルを監視します。IPアドレス、トレントクライアント、共有ピースなど、ピアに関するデータを収集します。収集されたデータは、さらなる分析のためにMySQLデータベースに保存されます。日本にあるピアのみを監視しますが、世界中のピアを監視する能力があります。この位置設定はハードコードされており、torrent-monitor.js
のGET /monitor/:torrent
Express APIエンドポイントで変更できます。
- WebTorrentを使用してBitTorrentネットワークに接続
- 指定されたトレントファイルを監視
- IPアドレスやトレントクライアントなど、ピアに関するデータを収集
- 収集したデータをMySQLデータベースに保存
- ピアのチェック、監視の停止、テーブルの削除のためのAPIエンドポイントを提供
- データベース内の特定のピアの検索をサポート
- リポジトリをクローンします:
git clone https://github.com/Artoriun/torrent-monitor.git
- 依存関係をインストールします:
npm install
-
MySQLデータベースをセットアップし、torrent-database.jsの接続詳細を更新します。
-
アプリケーションを起動します:
node torrent-monitor.js
アプリケーションを操作するには、以下のExpressエンドポイントを使用します。デフォルトでは、Expressサーバーはlocalhost:3000にあります。
-
トレントの監視を開始: GET /monitor/:torrent :torrentを監視したいトレントのマグネットリンクまたはハッシュに置き換えます。
-
監視中のトレントのピアをチェック: GET /check/:torrent :torrentを監視中のトレントのハッシュに置き換えます。
-
トレントの監視を停止: GET /stopMonitoring/:torrent :torrentを監視中のトレントのハッシュに置き換えます。
-
トレントのデータベーステーブルを削除: GET /drop/:torrent :torrentを監視中のトレントのハッシュに置き換えます。
-
ピアを検索: GET /:search/:torrent :searchを検索語に、:torrentを監視中のトレントのハッシュに置き換えます。
詳細なAPIドキュメンテーションについては、右側のサイドメニューとtorrent-monitor.jsおよびtorrent-database.jsファイル内のコメントを参照してください。
- WebTorrent: https://webtorrent.io/
- geoip-lite: https://github.com/fiorix/freegeoip
- mysql2: https://github.com/sidorares/node-mysql2
A Node.js application designed to monitor torrent files and obtain data from peers.
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
.
- 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
- Clone the repository:
git clone https://github.com/Artoriun/torrent-monitor.git
- Install dependencies:
npm install
-
Set up a MySQL database and update the connection details in
torrent-database.js
. -
Start the application:
node torrent-monitor.js
Use the following Express endpoints to operate the application. By the default the Express server is located at localhost:3000
.
-
Start monitoring a torrent: GET /monitor/:torrent
Replace
:torrent
with the magnet link or hash of the torrent you want to monitor. -
Check peers for a monitored torrent: GET /check/:torrent
Replace
:torrent
with the hash of the monitored torrent. -
Stop monitoring a torrent: GET /stopMonitoring/:torrent
Replace
:torrent
with the hash of the monitored torrent. -
Drop the database table for a torrent: GET /drop/:torrent
Replace
:torrent
with the hash of the monitored torrent. -
Search for peers: GET /:search/:torrent
Replace
:search
with a search term and:torrent
with the hash of the monitored torrent.
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.
- WebTorrent: https://webtorrent.io/
- geoip-lite: https://github.com/fiorix/freegeoip
- mysql2: https://github.com/sidorares/node-mysql2