BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

torrentsdl.class.php 1.2KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. class TorrentsDL
  3. {
  4. # ...
  5. /**
  6. * Create a Zip object and store the query results
  7. *
  8. * @param mysqli_result $QueryResult results from a query on the collector pages
  9. * @param string $Title name of the collection that will be created
  10. * @param string $AnnounceURL URL to add to the created torrents
  11. */
  12. public function __construct(&$QueryResult, $Title)
  13. {
  14. G::$Cache->InternalCache = false; // The internal cache is almost completely useless for this
  15. Zip::unlimit(); // Need more memory and longer timeout
  16. $this->QueryResult = $QueryResult;
  17. $this->Title = $Title;
  18. $this->User = G::$LoggedUser;
  19. $this->AnnounceURL = ANNOUNCE_URLS[0][0].'/'.G::$LoggedUser['torrent_pass'].'/announce';
  20. function add_passkey($Ann)
  21. {
  22. return (is_array($Ann)) ? array_map('add_passkey', $Ann) : $Ann.'/'.G::$LoggedUser['torrent_pass'].'/announce';
  23. }
  24. $this->AnnounceList = array(array_map('add_passkey', ANNOUNCE_URLS[0]), ANNOUNCE_URLS[1]);
  25. #$this->AnnounceList = (sizeof(ANNOUNCE_URLS) === 1 && sizeof(ANNOUNCE_URLS[0]) === 1) ? [] : array_map('add_passkey', ANNOUNCE_URLS);
  26. $this->Zip = new Zip(Misc::file_string($Title));
  27. }
  28. # ...
  29. }