Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

inkrement/torrent-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Torrent Scraper

This library is based on Fernando Carlétti`s torrent-scraper. It provides an abstraction to search for torrent files across some torrent websites.

Usage

First you have to install it using 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();
  }
}

Proxy

You can pass Guzzle httpClient options directly to the adapters.

$scraperService = new TorrentScraperService();

//add adapter
$pirateBayAdapter = new ThePirateBayAdapter(['proxy' => 'http://username:password@example.com:3128']);
$scraperService->addAdapter($pirateBayAdapter);

$result = $scraperService->search('elementaryos');

Available adapters