sergey-s-moiseev/torrent-scraper

为在许多网站上搜索种子文件提供抽象层。

v1.0.4 2016-10-14 02:58 UTC

This package is auto-updated.

Last update: 2024-09-23 23:46:19 UTC


README

关于

此库提供了一种搜索某些种子网站的种子文件的抽象层。

使用方法

<?php

$scraperService = new \SergeySMoiseev\TorrentScraper\TorrentScraperService([
    \SergeySMoiseev\TorrentScraper\Adapter\EzTvAdapter::ADAPTER_NAME,
    \SergeySMoiseev\TorrentScraper\Adapter\KickassTorrentsAdapter::ADAPTER_NAME
]);
$results = $scraperService->search('query');

foreach ($results as $result) {
	$result->getName();
    $result->getSource();
    $result->getSeeders();
    $result->getLeechers();
    $result->getTorrentUrl();
    $result->getMagnetUrl();
    $result->getDetailsUrl();
    $result->getCategory();
    $result->getSize();
}

额外的种子信息

要通过公告追踪器抓取种子和同行信息,请使用 /daemon 文件夹中的 Python 守护进程。

守护进程使用

python daemon/main.py 

服务器已启动在 0.0.0.0:5000(默认)上,要获取更多信息,您需要向服务器发送 POST JSON 请求 [Content-Type:application/json]

{"data":
  {
    "trackers": ["udp://tracker1.wasabii.com.tw:6969/announce",""],
    "hashes": ["89925fb48cae260801f35fb7175530bf6e5e055a", ""]
  },
  "callback": "http://yousite.url/callback_action",
  "private_key": "your_ip_key" 

}

位置

  • 追踪器 - 公告服务器列表
  • 散列 - 种子散列
  • 回调 - 结果 JSON 的回调动作的 URL ('http://' 或 'https://' 很重要!)
  • private_key - 保护您的动作的自生成密钥(建议:为每个请求生成新密钥) ``

结果 JSON 格式

{"data":
    [
      {"89925fb48cae260801f35fb7175530bf6e5e055a": {"peers": 1234, "seeds": 4321},
      ""
    ]
}
<?php

$scraperService = new \SergeySMoiseev\TorrentScraper\TorrentScraperService();
$query = [
    "trackers": ["udp://tracker1.wasabii.com.tw:6969/announce",""],
    "hashes": ["89925fb48cae260801f35fb7175530bf6e5e055a", ""]
];
$results = $scraperService->scrap($query, "http://yousite.url/callback_action", "your_ip_key");

收集公告追踪器的信息后,结果将在回调 URL 上返回

检查守护进程是否正在运行

<?php

$scraperService = new \SergeySMoiseev\TorrentScraper\TorrentScraperService();
$results = $scraperService->ping();

可用的适配器