Members   Search      Help    Register    Login    Home
Home » Discussion Forums » M0dZ & HaCkZ » Scrape...External(External scraping for torrents)
icon7.gif  Scrape...External [message #3138] Fri, 06 November 2009 04:38 Go to next message
jasonwebbb is currently offline jasonwebbb  India
Messages: 4
Registered: November 2009
Location: Imba City
Leecher
Well, I have to put some torrents on my site. I won't be setting up a tracker, but I need to be able to get their seed/leech information whenever the relevant page is visited. I have been trying to do this for a long time, but haven't found any way to do so. Can I use the scrape-external.php in the phpMyBittorrent package to do so ? Or is there any alternative way of achieving this ?
Re: Scrape...External [message #3141 is a reply to message #3138] Fri, 06 November 2009 09:04 Go to previous messageGo to next message
Threedays is currently offline Threedays  Australia
Messages: 79
Registered: January 2009
Location: Australia
Seeder
scrape-external is the script used to manually scrape torrent statistics. The cleanup.php is what's does the auto external scrapes.

cleanup.php runs in the background through and after footer.php is run by whom ever.


Re: Scrape...External [message #3150 is a reply to message #3141] Fri, 06 November 2009 21:19 Go to previous messageGo to next message
Daffy is currently offline Daffy  United Kingdom
Messages: 359
Registered: October 2009
Location: uk
Releaser

you can see how many leechs, seeds and completed, but you would not be able to see who is downloading them or get the speeds from ext stats. you would need to some code from the ext tracker to pull in there info from site, i do believe. i had this issues once before with ext trackers. to solve this, i went private. that way my users know what they get is real and safe.

Re: Scrape...External [message #3183 is a reply to message #3138] Thu, 12 November 2009 11:36 Go to previous messageGo to next message
jasonwebbb is currently offline jasonwebbb  India
Messages: 4
Registered: November 2009
Location: Imba City
Leecher
Well, all i need to be able to do is, make a , for eg. scrape.php. pass it some info like, the torrent file itself. den it shud be able to parse it, n scrape info on how many seeds/leechs are there for that torrent. Very Happy i don't think its impossible to do it,but i guess it might be hard.
Re: Scrape...External [message #3188 is a reply to message #3183] Fri, 13 November 2009 09:27 Go to previous messageGo to next message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
scrape External uses DomXml with convertion is you do not use it then you well only get errors.
It can be done but it well not be easy.


http://a.imageshack.us/img831/5562/mybikes.png
Re: Scrape...External [message #3235 is a reply to message #3188] Tue, 24 November 2009 14:36 Go to previous messageGo to next message
jasonwebbb is currently offline jasonwebbb  United States
Messages: 4
Registered: November 2009
Location: Imba City
Leecher
Well, it won't be easy, that I had in mind when I wanted to make this. Right now, i would say its a tempporary method, but I used Simple Dom Parser framework in php, and i simply read the seeder/leech info on the public tracker page. It does not scrape torrent. All it does is parse that page of the tracker/indexer. For now its working fine for mininova and piratebay. But its almost impossible for me to add support for other trackers/indexers. Like isohunt.
Re: Scrape...External [message #3236 is a reply to message #3138] Tue, 24 November 2009 14:39 Go to previous messageGo to next message
jasonwebbb is currently offline jasonwebbb  United States
Messages: 4
Registered: November 2009
Location: Imba City
Leecher
Btw, even if i get some information on structure of the torrent file, and how the scraping is done, I might be able to write up some code .
Re: Scrape...External [message #4086 is a reply to message #3236] Sat, 08 May 2010 12:06 Go to previous messageGo to next message
LogIN is currently offline LogIN  Croatia
Messages: 6
Registered: May 2010
Leecher
maybe i misunderstood you but if you wont to get seeds, peers stats from torrent (external trackers) you can do it like this:

lats say: $trackers is array of tracker urls:

<?php

include "functions.php";

function hexx2bin($RawInput){
      $BinStr = "";
      for ($i = 0; $i < strlen($RawInput); $i += 2)
          $BinStr .= "%" . substr($RawInput, $i, 2);
      return rawurldecode($BinStr);
}

function get_torrent($url, $time){
      $ch = curl_init();
      $header[0] = "Accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
      $header[] = "Cache-Control: max-age=0";
      $header[] = "Accept-Language: en-us,en;q=0.5";
      $header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
      $header[] = "Keep-Alive: 115";
      $header[] = "Connection: keep-alive";
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6");
      curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
      curl_setopt($ch, CURLOPT_ENCODING, "gzip,deflate");
      curl_setopt($ch, CURLOPT_AUTOREFERER, true);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
      curl_setopt($ch, CURLOPT_TIMEOUT, $time);
      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
      $result_torrent = curl_exec($ch);
      curl_close($ch);
      return $result_torrent;
}


$seeds = 0;
$leechs = 0;
$downloads = 0;
$i = 0;

if (is_array($trackers)) {
    foreach (array_unique($trackers) as $tracker) {
    $scrape = str_replace("announce", "scrape", $tracker);
    $sources = bdec(get_torrent($scrape . "?info_hash=" . urlencode(hex2bin($info)), 3));
    $seeds = $seeds + $sources['files'][hex2bin($info)]['complete'];
    $leechs = $leechs + $sources['files'][hex2bin($info)]['incomplete'];
    $downloads = $downloads + $sources['files'][hex2bin($info)]['downloaded'];
$i++;
} 

echo "Seeds: " . $seeds . "<br />";
echo "Leechs: " . $leechs . "<br />";
echo "Downloads: " . $downloads;

?>


More Info: URL

[Updated on: Sat, 08 May 2010 12:08]

Report message to a moderator

Re: Scrape...External [message #4091 is a reply to message #4086] Sat, 08 May 2010 14:50 Go to previous message
joeroberts is currently offline joeroberts  United States
Messages: 1971
Registered: June 2006
Location: U.S.A
Releaser
Da HacKer
there is already a peer updater.
if you look in details or in torrent list you well see the
http://torrenty.servebeer.com/themes/vista/pics/refresh.pngthis is a link for updatine them there is a timer on it so if it has been updated in the last 15 minutes it well show as http://torrenty.servebeer.com/themes/vista/pics/refresh_gray.pngthis one is not clickable.


http://a.imageshack.us/img831/5562/mybikes.png
Previous Topic:Google Adverts
Next Topic:working on BBcode threw data base
Goto Forum:
  


Current Time: Wed Feb 08 21:57:35 GMT 2012

Total time taken to generate the page: 0.00765 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software