inkrement / torrent-scraper
此包已废弃且不再维护。未建议替代包。
提供在多个网站上搜索种子文件的抽象。
v2.3.2
2016-10-23 11:07 UTC
Requires
- php: >=5.5
- ext-curl: *
- gabrielelana/byte-units: ^0.3.0
- guzzlehttp/guzzle: ~6.2
- symfony/css-selector: >=2.6
- symfony/dom-crawler: >=2.6
Requires (Dev)
- phpunit/phpunit: 5.2.*
- squizlabs/php_codesniffer: 2.*
- symfony/var-dumper: >=2.6
This package is not auto-updated.
Last update: 2021-02-02 05:45:28 UTC
README
这个库基于 Fernando Carlétti的 torrent-scraper,它提供了一种在部分种子网站上搜索种子文件的抽象。
使用方法
首先使用composer安装它
composer require inkrement/torrent-scraper
<?php require 'vendor/autoload.php'; use Inkrement\TorrentScraper\TorrentScraperService; date_default_timezone_set('UTC'); $scraperService = new TorrentScraperService(['ezTv', 'ThePirateBay']); $results = $scraperService->search('elementaryos'); foreach($tracker as $tracker_results){ echo $tracker_results->getTracker()."\n"; foreach ($tracker_results->getSearchResult() as $result) { $result->getName(); $result->getSeeders(); $result->getLeechers(); $result->getTorrentUrl(); $result->getMagnetUrl(); } }
代理
您可以直接将 Guzzle httpClient 选项传递给适配器。
$scraperService = new TorrentScraperService(); //add adapter $pirateBayAdapter = new ThePirateBayAdapter(['proxy' => 'http://username:password@example.com:3128']); $scraperService->addAdapter($pirateBayAdapter); $result = $scraperService->search('elementaryos');