Closed RonnyDT closed 7 years ago
Can you share the code please?
At the top of my upload.php:
require 'scraper.php';
Then I use torrent-rw by adriengibrat and fix it's array to match what Scrapeer needs.
$scraper = new Scrapeer\Scraper();
$hash = array($torrent->hash_info());
$trackers = array(); $announcelist = $torrent->announce();
foreach ($announcelist as $key => $value) {
array_push($trackers, $value[0]);
}
$info = $scraper->scrape($hash, $trackers, 5, 2);
Just tried to reproduce here.
Using this code:
<?php
require_once 'scraper.php';
require_once 'torrents.php';
$scraper = new Scrapeer\Scraper();
$torrent = new Torrent( './my.torrent' );
$hash = array( $torrent->hash_info() );
$trackers = array();
$announcelist = $torrent->announce();
foreach ( $announcelist as $key => $value ) {
array_push( $trackers, $value[0] );
}
$info = $scraper->scrape( $hash, $trackers, 5, 2 );
print_r( $info );
It works as expected. The only difference is that I'm using PHP 7.0. Can you try the code above a see if it works? Otherwise the issue must be somewhere else.
Turns out PHP doesn't support type hints for strings prior to version 7.0. I just pushed a new version that should work with any version of PHP >= 5.4.0. Please let me know how it goes.
I'm now getting the following error when trying to get scrape data from an UDP tracker:
Fatal error: Call to undefined function Scrapeer\random_int() in scraper.php on line 324
Checked the php_manual and the random_int() function is also phpv7.0.
You are right of course. Switched to mt_rand() instead. Thanks for the feedback!
No problem, thank you for the fast responses and fixes!
Hi I'm pretty new to this and tried your library today as it can scrape udp but whenever i'm trying to scrape I get this error:
Tested with Driverpack torrent:
Basically copy pasted a basic usage example. Am I doing something wrong?
Thanks!