site = $s->get(); $this->echooutput = $echooutput; $this->db = new DB(); $this->c = new ColorCLI; $this->functions = new Functions(); } // Retrieve pre info from predb sources and store them in the DB. // Returns the quantity of new titles retrieved. public function updatePre() { $f = new Functions(); $newNames = 0; $newestRel = $this->db->queryOneRow("SELECT value AS adddate FROM tmux WHERE setting = 'lastpretime'"); if ((int)$newestRel['adddate'] < (time() - 600)) { if ($this->echooutput) { echo $this->c->header("Retrieving titles from preDB sources."); } if (self::PRE_WOMBLE) { $newNames += $newWomble = $this->retrieveWomble(); if ($this->echooutput) { echo $this->c->primary($newWomble . " \tRetrieved from Womble."); } } if (self::PRE_OMGWTF) { $newNames += $newOmgWtf = $this->retrieveOmgwtfnzbs(); if ($this->echooutput) { echo $this->c->primary($newOmgWtf . " \tRetrieved from Omgwtfnzbs."); } } if (self::PRE_ZENET) { $newNames += $newZenet = $this->retrieveZenet(); if ($this->echooutput) { echo $this->c->primary($newZenet . " \tRetrieved from Zenet."); } } if (self::PRE_PRELIST) { $newNames += $newPreList = $this->retrievePrelist(); if ($this->echooutput) { echo $this->c->primary($newPreList . " \tRetrieved from Prelist."); } } if (self::PRE_ORLYDB) { $newNames += $newOrly = $this->retrieveOrlydb(); if ($this->echooutput) { echo $this->c->primary($newOrly . " \tRetrieved from Orlydb."); } } if (self::PRE_SRRDB) { $newNames += $newSrr = $this->retrieveSrr(); if ($this->echooutput) { echo $this->c->primary($newSrr . " \tRetrieved from Srrdb."); } } if (self::PRE_PREDBME) { $newNames += $newPdme = $this->retrievePredbme(); if ($this->echooutput) { echo $this->c->primary($newPdme . " \tRetrieved from Predbme."); } } if (self::PRE_ABGXNET) { $newNames += $abgx = $this->retrieveAbgx(); if ($this->echooutput) { echo $this->c->primary($abgx . " \tRetrieved from abgx."); } } if (self::PRE_UCRAWLER) { $newNames += $newUsenetCrawler = $this->retrieveUsenetCrawler(); if ($this->echooutput) { echo $this->c->primary($newUsenetCrawler . " \tRetrieved from Usenet-Crawler."); } } if (self::PRE_MOOVEE) { $newNames += $newMoovee = $this->retrieveAllfilledMoovee(); if ($this->echooutput) { echo $this->c->primary($newMoovee . " \tRetrieved from Allfilled Moovee."); } } if (self::PRE_TEEVEE) { $newNames += $newTeevee = $this->retrieveAllfilledTeevee(); if ($this->echooutput) { echo $this->c->primary($newTeevee . " \tRetrieved from Allfilled Teevee."); } } if (self::PRE_EROTICA) { $newNames += $newErotica = $this->retrieveAllfilledErotica(); if ($this->echooutput) { echo $this->c->primary($newErotica . " \tRetrieved from Allfilled Erotica."); } } if (self::PRE_FOREIGN) { $newNames += $newForeign = $this->retrieveAllfilledForeign(); if ($this->echooutput) { echo $this->c->primary($newForeign . " \tRetrieved from Allfilled Foreign.\n"); } } if ($this->echooutput) { echo $this->c->primary($newNames . " \tRetrieved from all the above sources.."); } // If we found nothing, update the last added to now to reset the timer. $this->db->exec(sprintf("UPDATE tmux SET value = %s WHERE setting = 'lastpretime'", $this->db->escapeString(time()))); } return $newNames; } // Attempts to match predb to releases. public function checkPre($nntp) { $matched = $this->matchPredb(); if ($this->echooutput) { $count = ($matched > 0) ? $matched : 0; echo $this->c->header('Matched ' . number_format($count) . ' prehash titles to release search names.'); } $nfos = $this->matchNfo($nntp); if ($this->echooutput) { $count = ($nfos > 0) ? $nfos : 0; echo $this->c->header("\nAdded " . number_format($count) . ' missing NFOs from preDB sources.'); } } /** * Retrieve new pre info from womble. * * @return int */ protected function retrieveWomble() { $newNames = $updated = 0; $buffer = $this->getUrl('http://www.newshost.co.za'); if ($buffer !== false) { $matches = $match = $matches2 = array(); if (preg_match_all('/