Advertisement
Guest User

Untitled

a guest
May 28th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.41 KB | None | 0 0
  1. <?php
  2.  
  3. // we include the functions we will need
  4. include 'functions.php';
  5.  
  6. // the path/url to the torrent
  7. $torrent_data = bdec(file_get_contents('[gdaponto2.com]avengers.age.of.ultron.2015.new.source.720p.hdts.xvid.mp3.titan.torrent'));
  8.  
  9. // we need these variables to get the number of users sharing the torrent
  10. $info = strtolower(sha1(benc($torrent_data['info'])));
  11. $scrape = str_replace('announce', 'scrape', $torrent_data['announce']);
  12. $sources = bdec(@file_get_contents($scrape . '?info_hash=' . urlencode(hex2bin($info))));
  13.  
  14. // let's display the files in the torrent
  15. // since the structure of the torrent is different if it has only one file or more files, we have to count number of files in it
  16. $c = count($torrent_data['info']['files']);
  17. echo '<h2>Files</h2>';
  18.  
  19. // if it has more then one file do a loop and display all the files; else display the name of the file
  20. if ($c > 1) {
  21.     for ($i = 0; $i < $c; $i++) {
  22.         echo $torrent_data['info']['files'][$i]['path']['0'] . '<br/>';
  23.     }
  24. } else {
  25.     echo $torrent_data['info']['name'] . '<br/>';
  26. }
  27.  
  28. // let's display the sources
  29. $seeds = $sources['files'][hex2bin($info)]['complete'];
  30. $leechs = $sources['files'][hex2bin($info)]['incomplete'];
  31. $downloads = $sources['files'][hex2bin($info)]['downloaded'];
  32.  
  33. echo '<h2>Sources</h2>' .
  34.     '<b>Seeds:</b> ' . $seeds . '<br/>' .
  35.     '<b>Leechs:</b> ' . $leechs . '<br/>' .
  36.     '<b>Downloads:</b> ' . $downloads . '<br/>';
  37.    
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement