• Resolved tomsko

    (@tomsko)


    Hi, I just started running my 4th WordPress site, and this is my first project that involves torrents.
    Basically I don’t host any .torrent files myself, I just hyperlink Magnet links from Piratebay.

    The problem is that after hours of Googling I can’t find a simple script that will echo currend peers (seeders / leechers) of torrent.

    Is it possible, and if yes, than how?

    I did find one method, but it’s more trouble (+illegal) than worth it – with the help of online tool I can get torrent file from magnet link, than upload it to my website (that’s where it gets illegal) and then scrap peers.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter tomsko

    (@tomsko)

    Ok you can close this topic, I found an answer! This script will work with all PirateBay Torrents. It screen scapes peers.

    <?php
    $data = file_get_contents("http://link-to-piratebay-torrent-page.com");
    preg_match("#<dt>Seeders:<\/dt>\s*<dd>(.*)<\/dd>#iU", $data, $match1);
    preg_match("#<dt>Leechers:<\/dt>\s*<dd>(.*)<\/dd>#iU", $data, $match2);
    echo $match1[1]; //seeders
    echo $match2[1]; //leechers
    ?>

    Thanks tomsko, this code is really useful. What is supposed to go into the http://link-to-piratebay-torrent-page.com space. I think that this URL is broken. Oh, is it supposed to be the Pirate Bay torrent page? I get it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to echo real time seeders for magnet torrent?’ is closed to new replies.