GithubHelp home page GithubHelp logo

medariox / scrapeer Goto Github PK

View Code? Open in Web Editor NEW
89.0 12.0 29.0 41 KB

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

PHP 100.00%
torrent tracker scraper information

scrapeer's People

Contributors

codacy-badger avatar medariox avatar psociety avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scrapeer's Issues

Fatal error: Uncaught Error: Call to undefined function Scrapeer\socket_create()

Hi, I am new in Torrent I am facing this issue. please reply me ASP.

Fatal error: Uncaught Error: Call to undefined function Scrapeer\socket_create() in C:\xampp\htdocs\scrapeer-master\scraper.php:426 Stack trace: #0 C:\xampp\htdocs\scrapeer-master\scraper.php(409): Scrapeer\Scraper->udp_create_connection('tracker.coppers...', 6969) #1 C:\xampp\htdocs\scrapeer-master\scraper.php(382): Scrapeer\Scraper->prepare_udp('tracker.coppers...', 6969) #2 C:\xampp\htdocs\scrapeer-master\scraper.php(174): Scrapeer\Scraper->scrape_udp(Array, 'tracker.coppers...', 6969, false) #3 C:\xampp\htdocs\scrapeer-master\scraper.php(101): Scrapeer\Scraper->try_scrape('udp', 'tracker.coppers...', 6969, '', false) #4 C:\xampp\htdocs\scrapeer-master\test.php(8): Scrapeer\Scraper->scrape(Array, Array) #5 {main} thrown in C:\xampp\htdocs\scrapeer-master\scraper.php on line 426

Use

i want to use this php code in my wordpress site how can i use it ???

My Srape return information from 1 tracker inseatd of 30

Hi

I use this code :

require 'cfg/class.scraper.php';
$scraper = new Scrapeer\Scraper();

$trackers = array(_ARRAY_OF_30_TRACKERS_);
$hash = array( '03BB57EA1F7E8DC9CC7DA349B549D7A7C5BC3359' );

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

He return only 1 info :

Array
(
[03BB57EA1F7E8DC9CC7DA349B549D7A7C5BC3359] => Array
(
[seeders] => 293
[completed] => 19740
[leechers] => 38
)

)

Why doesn't it return the information from all the scrapped trackers?

peers

Можно сделать выбор между announce и scrape

Reduce the time

It is possible to reduce the execution time, because I found it a little slow in the execution.

Error: Scrapeer\Scraper::try_scrape() must be an instance of Scrapeer\string

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:

Catchable fatal error: Argument 1 passed to Scrapeer\Scraper::try_scrape() must be an instance of Scrapeer\string, string given, called in scraper.php on line 87 and defined in scraper.php on line 108

Tested with Driverpack torrent:

Used hash array: Array ( [0] => a694ac1c039393e709de9979a7e7a176d6c0d809 )
Tracker array: Array ( [0] => http://tracker.trackerfix.com:80/announce [1] => udp://9.rarbg.me:2710/announce [2] => udp://9.rarbg.to:2710/announce [3] => udp://9.rarbg.com:2710/announce [4] => udp://tracker.trackerfix.com:80/announce ) 
PHP Version: 5.4.17

Basically copy pasted a basic usage example. Am I doing something wrong?

Thanks!

List Connected IPs

Is there a way you can list the connected clients to a torrent? It seems like the functionality is basically there already... but I can't see any code for it.

Get Meta Data

Hi,

Great library 👍
How can I get meta data like directory/torrent name ?

Thanks

Couldn't write/connect to socket.

Hi medariox,

Since today i've not been able to get any seed/peer data because of socket issues on my live webhosting/domain. Localwebhost works fine. This issue probably lies at my hoster's end I suppose? Note: all the "couldn't write/connect to socket" trackers are UDP.

Array ( [0] => Invalid scrape connection (explodie.org:6969). [1] => Invalid scrape response (tracker.tfile.me:80). [2] => Invalid scrape connection (bigfoot1942.sektori.org:6969). [3] => Couldn't write to socket. [4] => Couldn't write to socket. [5] => Couldn't write to socket. [6] => Couldn't write to socket. [7] => Couldn't connect to socket. [8] => Couldn't write to socket. [9] => Couldn't write to socket. [10] => Couldn't write to socket. [11] => Couldn't write to socket. [12] => Couldn't connect to socket. [13] => Couldn't write to socket. )

Any ideas?

Scrape method trims custom announcement path in URI

I'm getting following error for one of my trackers, that has announce/scrape listener placed in sub-folder like

http://somehost:80/directory/announce

$scraper->get_errors() 

Array
(
    [0] => Invalid scrape connection (somehost:80).
)

after enable file_get_contents get output

PHP Warning:  file_get_contents(http://somehost:80/scrape?info_hash=somehash): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

in other words, my original address was replaced to the domain root

http://somehost:80/announce

Other trackers, that stores theirs announce listeners in the root - works well, suppose that's get_passkey issue where parser confuses by regex at line

if ( ! is_null( $path ) && preg_match( '/[a-z0-9]{32}/i', $path, $matches ) ) {

Error

Warning:  file_get_contents(http://182.176.139.129:6969/scrape?info_hash=%0E%1B%1A%2F%5B%E2%09%E1%15%7C%14%8F%AA%F8%AF%D3%A3%AA8%24): failed to open stream: ������ ��������� ���������� ��� ����������, �.�. �� ������� �������� �� ��������� ���� �� ������ ����� ������, ��� ��� ��������� ��� ������������� ���������� ��-�� ��������� ������� ��� ����������� ��������.
 in ...\scraper.php on line 252



Warning:  file_get_contents(http://5.79.83.193:2710/scrape?info_hash=%0E%1B%1A%2F%5B%E2%09%E1%15%7C%14%8F%AA%F8%AF%D3%A3%AA8%24): failed to open stream: ������ ��������� ���������� ��� ����������, �.�. �� ������� �������� �� ��������� ���� �� ������ ����� ������, ��� ��� ��������� ��� ������������� ���������� ��-�� ��������� ������� ��� ����������� ��������.
 in ...\scraper.php on line 252



Warning:  file_get_contents(http://91.218.230.81:6969/scrape?info_hash=%0E%1B%1A%2F%5B%E2%09%E1%15%7C%14%8F%AA%F8%AF%D3%A3%AA8%24): failed to open stream: ������ ��������� ���������� ��� ����������, �.�. �� ������� �������� �� ��������� ���� �� ������ ����� ������, ��� ��� ��������� ��� ������������� ���������� ��-�� ��������� ������� ��� ����������� ��������.
 in ...\scraper.php on line 252

Array
(
    [0] => Invalid infohash (0e1b1a2f5be209e1157c148faaf8afd3a3aa3824) for tracker: public.popcorn-tracker.org.
    [1] => Invalid scrape response (182.176.139.129:6969).
    [2] => Invalid scrape response (5.79.83.193:2710).
    [3] => Invalid scrape response (91.218.230.81:6969).
)
Array
(
    [0e1b1a2f5be209e1157c148faaf8afd3a3aa3824] => Array
        (
            [seeders] => 2865
            [completed] => 0
            [leechers] => 33
        )

)

Executable code

$tracker = array('udp://public.popcorn-tracker.org:6969/announce',
    'http://182.176.139.129:6969/announce',
    'http://5.79.83.193:2710/announce',
    'http://91.218.230.81:6969/announce',
    'http://bt01.nnm-club.cc:2710/announce',
    'http://atrack.pow7.com/announce');
$hash = array( '0e1b1a2f5be209e1157c148faaf8afd3a3aa3824' );

$info = $scraper->scrape( $hash, $tracker );


if ( $scraper->has_errors() ) {
    // Get the errors and print them.
    print_r( $scraper->get_errors() );
}

print_r( $info );

File info

Are you able to add results of file(s) in addition to seeds, leechers etc...

Fatal Error

I get a fatal error when running this code:

require 'scraper.php';

$scraper = new Scrapeer\Scraper();

$tracker = array('udp://tracker.coppersurfer.tk:6969/announce',
    'udp://tracker.leechers-paradise.org:6969/announce',
    'udp://95.213.191.124:2710/announce',
    'udp://mgtracker.org:6969/announce',
    'http://p4p.arenabg.ch:1337/announce',
    'http://www.opentrackr.org/announce');

$hash = array( '4344503B7E797EBF31582327A5BAAE35B11BDA01' );

$info = $scraper->scrape( $hash, $tracker );

print_r( $info );

// Check if we have any errors.
if ( $scraper->has_errors() ) {
    // Get the errors and print them.
	echo '<pre>';
    print_r( $scraper->get_errors() );
}

Fatal error: Uncaught Error: Call to undefined function Scrapeer\socket_create() in scraper.php:345 Stack trace: #0 scraper.php(189): Scrapeer\Scraper->udp_create_connection(2, 'tracker.coppers...', 6969) #1 scraper.php(115): Scrapeer\Scraper->scrape_udp(Array, 2, 'tracker.coppers...', 6969) #2 scraper.php(86): Scrapeer\Scraper->try_scrape('udp', 'tracker.coppers...', 6969, '', 2) #3 index.php(16): Scrapeer\Scraper->scrape(Array, Array) #4 {main} thrown in scraper.php on line 345

This seems to happen to a lot trackers except some few.
For example, if I switch the first and last tracker using:

$tracker = array('http://www.opentrackr.org/announce', // here
    'udp://tracker.leechers-paradise.org:6969/announce',
    'udp://95.213.191.124:2710/announce',
    'udp://mgtracker.org:6969/announce',
    'http://p4p.arenabg.ch:1337/announce',
    'udp://tracker.coppersurfer.tk:6969/announce'); // and here

I get:

Array ( [0e1b1a2f5be209e1157c148faaf8afd3a3aa3824] => Array ( [seeders] => 5 [completed] => 49 [leechers] => 0 ) )

PHP 8

Hi @medariox

In php 8 shut up operator(@) is no longer valid and sockets now return on success instance. Any chance to give this an update so it doesn't throw errors and stay future proof? Thank you for your work!

Strange problem

Hi i have try to run a basic example on my computer & unfortunately i obtain a blank page without any error

On my debian server it's working ( but no in my pc )
sorry for my bad english

`<?php

require_once 'scraper.php';


$scraper = new Scrapeer\Scraper();

$tracker = array('udp://public.popcorn-tracker.org:6969/announce',
    'http://182.176.139.129:6969/announce',
    'http://5.79.83.193:2710/announce',
    'http://91.218.230.81:6969/announce',
    'http://bt01.nnm-club.cc:2710/announce',
    'http://atrack.pow7.com/announce');

$hash = array( '0e1b1a2f5be209e1157c148faaf8afd3a3aa3824' );

$info = $scraper->scrape( $hash, $tracker );

print_r( $info );`

Possible to help me , thx very much

Possibility of DHT and Pex scrape

Is it possible to scrape DHT and Pex?
I found my torrent have seed ratio of 30+ but total completed count return by the trackers is 13

$scraper->scrape($btih, $tracker_list);

Edit:
I read the closed issues and found I've to implement my own loop. That's fine.

DHT/Pex possibility is still requested

how to read scrape file ?

there are some trackers which are providing scrape file, which has all the infohashes which are using the tracker and seeders and leechers count.,

e.g.
http://coppersurfer.tk/
The full aggregated scrape file is updated every 1 hour. The name of full scrape file may change in the future.
here : http://coppersurfer.tk/full_scrape_not_a_tracker.tar.gz

after unzipping i get scrape file which is 396 MB.

how can i use your library to read the file ? or is there any other way ?

Thanks

Problem in scraping seeds and leeches from torrent. On local host it works fine.

Hi, i have been using your scraper library for quite some time on my local host. But recently i launched torrent site and it raises a problem there. On local host it works fine.

Site: https://ghost-torrents.com

[0] => Invalid scrape connection (tracker.tfile.co:80).
[1] => Couldn't write to socket.
[2] => Couldn't write to socket.
[3] => Couldn't connect to socket.
[4] => Couldn't write to socket.
[5] => Couldn't write to socket.
[6] => Couldn't connect to socket.
[7] => Couldn't write to socket.
[8] => Couldn't write to socket.
[9] => Couldn't write to socket.
[10] => Couldn't write to socket.
[11] => Couldn't write to socket.
[12] => Couldn't write to socket.
[13] => Couldn't connect to socket.
[14] => Couldn't write to socket.
[15] => Couldn't write to socket.
[16] => Couldn't write to socket.
[17] => Couldn't connect to socket.
[18] => Couldn't write to socket.
[19] => Couldn't write to socket.
[20] => Couldn't write to socket.
[21] => Couldn't write to socket.
[22] => Couldn't write to socket.
[23] => Couldn't write to socket.
[24] => Couldn't write to socket.
[25] => Couldn't connect to socket.
[26] => Couldn't write to socket.
[27] => Couldn't write to socket.
[28] => Couldn't write to socket.
[29] => Couldn't write to socket.
[30] => Couldn't write to socket.
[31] => Couldn't write to socket.
[32] => Couldn't write to socket.
[33] => Couldn't write to socket.
[34] => Invalid scrape connection (explodie.org:6969).
[35] => Couldn't write to socket.
[36] => Couldn't write to socket.
[37] => Couldn't write to socket.

There are 37 trackers in this torrent file.

Error Socket

Warning:  socket_read(): unable to read from socket [10060]: ������ ��������� ���������� ��� ����������, �.�. �� ������� �������� �� ��������� ���� �� ������ ����� ������, ��� ��� ��������� ��� ������������� ���������� ��-�� ��������� ������� ��� ����������� ��������.
 in ...\scraper.php on line 351



Warning:  socket_read(): unable to read from socket [10060]: ������ ��������� ���������� ��� ����������, �.�. �� ������� �������� �� ��������� ���� �� ������ ����� ������, ��� ��� ��������� ��� ������������� ���������� ��-�� ��������� ������� ��� ����������� ��������.
 in ...\scraper.php on line 351



Warning:  socket_connect(): Host lookup failed [11001]: ���� ���� ����������.
 in ...\scraper.php on line 317



Warning:  socket_write(): unable to write to socket [10057]: ������ �� �������� ��� �������� ����  (when sending on a datagram socket using a sendto call) no address was supplied.
 in ...\scraper.php on line 333



Warning:  socket_read(): unable to read from socket [10022]: ������ ����������� ��������.
 in ...\scraper.php on line 351

error

I was unable to use the class, every time I execute it the error in the function udp_create_connection() line 426.
the line @socket_create.

I'm not able to solve it, I wonder if you could help me.

error

Error

$tracker = array('http://bt01.nnm-club.cc:2710/0055b4edb53392b5ac41b79d29131591/announce');
$hash = array( '0e1b1a2f5be209e1157c148faaf8afd3a3aa3824' );

$info = $scraper->scrape( $hash, $tracker );

echo "<pre>";
print_r( $info );
echo "</pre>";

Warning: file_get_contents(http://bt01.nnm-club.cc:2710/scrape?info_hash=%0E%1B%1A%2F%5B%E2%09%E1%15%7C%14%8F%AA%F8%AF%D3%A3%AA8%24): failed to open stream: HTTP request failed! in ...\scraper.php on line 243

К удалённым объектам обращаться только через сокеты или cURL'ом.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.