PHP code example of sergey-s-moiseev / torrent-scraper

1. Go to this page and download the library: Download sergey-s-moiseev/torrent-scraper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sergey-s-moiseev / torrent-scraper example snippets




$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();
}



$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");




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