All Projects → medariox → scrapeer

medariox / scrapeer

Licence: other
Essential PHP library that scrapes HTTP(S) and UDP trackers for torrent information.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to scrapeer

Animetrackerlist
动漫磁性链接加速方案(animeTrackerList)
Stars: ✭ 572 (+606.17%)
Mutual labels:  tracker, torrent
Unit3d Community Edition
🚀 A Next Generation Private Torrent Tracker (Community Edition)
Stars: ✭ 1,305 (+1511.11%)
Mutual labels:  tracker, torrent
Trackerslistcollection
🎈 Updated daily! A list of popular BitTorrent Trackers! / 每天更新!全网热门 BT Tracker 列表!
Stars: ✭ 9,761 (+11950.62%)
Mutual labels:  tracker, torrent
torrent
Bittorrent library implemented in pure Dart. [WIP, early development stage]
Stars: ✭ 26 (-67.9%)
Mutual labels:  tracker, torrent
Torrent Discovery
Discover BitTorrent and WebTorrent peers
Stars: ✭ 177 (+118.52%)
Mutual labels:  tracker, torrent
Nyaa
Bittorrent software for cats
Stars: ✭ 2,899 (+3479.01%)
Mutual labels:  tracker, torrent
Bittorrent Tracker
🌊 Simple, robust, BitTorrent tracker (client & server) implementation
Stars: ✭ 1,184 (+1361.73%)
Mutual labels:  tracker, torrent
Thepiratebay
💀 The Pirate Bay node.js client
Stars: ✭ 191 (+135.8%)
Mutual labels:  torrent, scraper
Wt Tracker
High-performance WebTorrent tracker
Stars: ✭ 144 (+77.78%)
Mutual labels:  tracker, torrent
Udpt
A lightweight UDP torrent tracker
Stars: ✭ 143 (+76.54%)
Mutual labels:  tracker, torrent
UNIT3D-INSTALLER
Provisioner and Installer for the UNIT3D Torrent Tracker Platform.
Stars: ✭ 43 (-46.91%)
Mutual labels:  tracker, torrent
SpooferBT
Relay torrent tracker communication via TCP to bypass a blocked UDP network.
Stars: ✭ 18 (-77.78%)
Mutual labels:  tracker, torrent
privtracker
Private BitTorrent tracker generator
Stars: ✭ 84 (+3.7%)
Mutual labels:  tracker, torrent
Torrent
Full-featured BitTorrent client package and utilities
Stars: ✭ 4,138 (+5008.64%)
Mutual labels:  tracker, torrent
webtorrent-health
💚 Get health info about a webtorrent file or magnet link
Stars: ✭ 27 (-66.67%)
Mutual labels:  tracker, torrent
Torrenter
Simple nodejs package to download torrents using torrent-indexer and webtorrent, especially movie and series.
Stars: ✭ 42 (-48.15%)
Mutual labels:  tracker, torrent
Warezz
It's illegal cuz they can't tax you!
Stars: ✭ 386 (+376.54%)
Mutual labels:  torrent, information
Gmdb
GMDB is the ultra-simple, cross-platform Movie Library with Features (Search, Take Note, Watch Later, Like, Import, Learn, Instantly Torrent Magnet Watch)
Stars: ✭ 189 (+133.33%)
Mutual labels:  torrent, scraper
Snail
基于Java、JavaFX开发的下载工具,支持下载协议:BT(BitTorrent、磁力链接、种子文件)、HLS(M3U8)、FTP、HTTP。人家才不要你的⭐⭐呢,哼
Stars: ✭ 102 (+25.93%)
Mutual labels:  tracker, torrent
Ipmagnet
Check which IP adresses your BitTorrent client is handing out to trackers
Stars: ✭ 200 (+146.91%)
Mutual labels:  tracker, torrent

Scrapeer

Essential PHP library that scrapes HTTP(S) and UDP trackers for torrent information.

scrapeer image

Original image by @alinnnaaaa.

Features

  • Retrieves seeders, leechers and completed torrent information
  • Supports HTTP, HTTPS and UDP trackers
  • Automatically discards invalid trackers and info-hashes
  • Allows setting timeout per tracker and max. number of trackers
  • Supports up to 64 info-hashes per scrape
  • Aims to be as lightweight, straightforward and efficient as possible
  • Supports scraping via scrape (default) and announce requests

Note

This is the only official source for Scrapeer. Other repositories — e.g. the ones on Packagist — are unofficial and should be avoided!

Basic usage examples

Single info-hash and single tracker:

require 'scraper.php';

$scraper = new Scrapeer\Scraper();

$tracker = array( 'udp://tracker.coppersurfer.tk:6969/announce' );
$hash = array( '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

$info = $scraper->scrape( $hash, $tracker );
print_r( $info );
Array ( ["4344503B7E797EBF31582327A5BAAE35B11BDA01"] => Array ( ["seeders"] => 88 ["completed"] => 7737 ["leechers"] => 6 ) )
  • If not specified, the port will default to 80 for HTTP/UDP and to 443 for HTTPS.
  • Single elements may also be strings instead of arrays.

Single info-hash and multiple trackers (recommended usage):

$trackers = array( 'http://www.opentrackr.org/announce', 'udp://tracker.coppersurfer.tk:6969/announce' );
$hash = array( '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

$info = $scraper->scrape( $hash, $trackers );
print_r( $info );
Array ( ["4344503B7E797EBF31582327A5BAAE35B11BDA01"] => Array ( ["seeders"] => 59 ["completed"] => 83 ["leechers"] => 3 ) )
  • First tracker in the array will be used, if it fails (invalid tracker, invalid info-hash or invalid info-hash for that tracker) the second tracker will be used and so on.
  • In this case we get a valid result from the first tracker, notice that we get different information for the same torrent - this is to be expected, as different trackers may be more or less up-to-date than others.

Multiple info-hashes and single tracker:

$tracker = array( 'http://tracker.internetwarriors.net:1337/announce' );
$hashes = array( '699cda895af6fbd5a817fff4fe6fa8ab87e36f48', '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

$info = $scraper->scrape( $hashes, $tracker );
print_r( $info );
Array ( ["699cda895af6fbd5a817fff4fe6fa8ab87e36f48"] => Array ( ["seeders"] => 4 ["completed"] => 236 ["leechers"] => 0 ) ["4344503B7E797EBF31582327A5BAAE35B11BDA01"] => Array ( ["seeders"] => 7 ["completed"] => 946 ["leechers"] => 3 ) )
  • Info-hashes can be upper or lower case.

Multiple info-hashes and multiple trackers:

$trackers = array( 'udp://tracker.coppersurfer.tk:6969/announce', 'http://explodie.org:6969/announce' );
$hashes = array( '699cda895af6fbd5a817fff4fe6fa8ab87e36f48', '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

$info = $scraper->scrape( $hashes, $trackers );
print_r( $info );
Array ( ["699cda895af6fbd5a817fff4fe6fa8ab87e36f48"] => Array ( ["seeders"] => 52 ["completed"] => 2509 ["leechers"] => 1 ) ["4344503B7E797EBF31582327A5BAAE35B11BDA01"] => Array ( ["seeders"] => 97 ["completed"] => 7751 ["leechers"] => 11 ) )

Advanced usage examples

Error logging

$trackers = array( 'http://invalidtracker:6767/announce', 'udp://tracker.coppersurfer.tk:6969/announce' );
$hashes = array( '699cda895af6fbd5a817fff4fe6fa8ab87e36f48', '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

$info = $scraper->scrape( $hashes, $trackers );

print_r( $info );

// Check if we have any errors.
if ( $scraper->has_errors() ) {
	// Get the errors and print them.
	print_r( $scraper->get_errors() );
}
Array ( ["699cda895af6fbd5a817fff4fe6fa8ab87e36f48"] => Array ( ["seeders"] => 49 ["completed"] => 2509 ["leechers"] => 1 ) ["4344503B7E797EBF31582327A5BAAE35B11BDA01"] => Array ( ["seeders"] => 99 ["completed"] => 7754 ["leechers"] => 7 ) ) Array ( [0] => "Invalid scrape connection (invalidtracker:6767)." )
  • The first tracker is not valid, it will be skipped and an error will be added to the error logger.
  • The scraper keeps scraping until one valid tracker is found or there are no more trackers to try.
  • Invalid info-hashes will be logged and skipped.

Advanced options

Maximum trackers

$trackers = array( 'http://invalidtracker:6767/announce', 'udp://tracker.coppersurfer.tk:6969/announce' );
$hashes = array( '699cda895af6fbd5a817fff4fe6fa8ab87e36f48', '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

// The max. amount of trackers to try is 1.
$info = $scraper->scrape( $hashes, $trackers, 1 );
  • The scraper will stop after the first tracker, regardless of its validity.
  • Default: All trackers in the array.

Timeout per tracker

$trackers = array( 'http://invalidtracker:6767/announce', 'udp://tracker.coppersurfer.tk:6969/announce' );
$hashes = array( '699cda895af6fbd5a817fff4fe6fa8ab87e36f48', '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

// The max. amount of trackers to try is 2 and timeout per tracker is 3s.
$info = $scraper->scrape( $hashes, $trackers, 2, 3 );
  • Each tracker will have a timeout of 3 seconds (total timeout in this case would be 6 seconds).
  • Default: 2 seconds (recommended).

Announce scraping

$trackers = array( 'udp://tracker.opentrackr.org:1337/announce', 'http://explodie.org:6969/announce' );
$hashes = array( '699cda895af6fbd5a817fff4fe6fa8ab87e36f48', '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

$info = $scraper->scrape( $hashes, $trackers, 2, 3, true );
  • Default: false.
  • Prefer scrape over announce requests for multiple info-hashes (usually faster).
  • Note: UDP trackers only return seeders and leechers information. This is a protocol limitation.

FAQs

  • What are info-hashes? How do I get them?

From The BitTorrent Protocol Specification:

The 20 byte sha1 hash of the bencoded form of the info value from the metainfo file. Note that this is a substring of the metainfo file. The info-hash must be the hash of the encoded form as found in the .torrent file, regardless of it being invalid. This value will almost certainly have to be escaped.

There are many ways to retrieve the info-hashes from your torrents, a PHP based solution would be torrent-bencode for example.

  • I need public trackers! Where can I find some?

Check out newTrackon and trackerslist.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].