From e41fdaba66f5a9a55b19244708139f0f9d38cf4e Mon Sep 17 00:00:00 2001 From: Darko Date: Fri, 30 May 2014 08:56:13 +0200 Subject: [PATCH] Moved some of the predb sources from prehash to IRCScraper.Fix in Konsole categorization.Definite fix for NZBGet blank username and password option. --- lib/IRCScraper.php | 7 ++++++- lib/IRCScraper/settings_example.php | 7 ++++++- lib/Konsole.php | 9 ++++++++- lib/copy_this/www/lib/users.php | 9 ++------- lib/prehash.php | 27 ++++++++++++++------------- 5 files changed, 36 insertions(+), 23 deletions(-) diff --git a/lib/IRCScraper.php b/lib/IRCScraper.php index 2cc72a7d4..cb9e1a0ea 100644 --- a/lib/IRCScraper.php +++ b/lib/IRCScraper.php @@ -104,7 +104,12 @@ class IRCScraper extends IRCClient '#pre@corrupt' => false, '#scnzb' => false, '#tvnzb' => false, - 'u4all.eu' => false + 'omgwtfnzbs' => false, + 'orlydb' => false, + 'prelist' => false, + 'srrdb' => false, + 'u4all.eu' => false, + 'zenet' => false ); } diff --git a/lib/IRCScraper/settings_example.php b/lib/IRCScraper/settings_example.php index c8e18516d..d2ec5e963 100644 --- a/lib/IRCScraper/settings_example.php +++ b/lib/IRCScraper/settings_example.php @@ -40,7 +40,12 @@ serialize( '#pre@corrupt' => false, '#scnzb' => false, '#tvnzb' => false, - 'u4all.eu' => false + 'omgwtfnzbs' => false, + 'orlydb' => false, + 'prelist' => false, + 'srrdb' => false, + 'u4all.eu' => false, + 'zenet' => false ) ) ); \ No newline at end of file diff --git a/lib/Konsole.php b/lib/Konsole.php index 47197fb7b..cc0235e31 100644 --- a/lib/Konsole.php +++ b/lib/Konsole.php @@ -12,6 +12,12 @@ require_once("ColorCLI.php"); class Konsole { + const REQID_NONE = -3; // The Request ID was not found locally or via web lookup. + const REQID_ZERO = -2; // The Request ID was 0. + const REQID_NOLL = -1; // Request ID was not found via local lookup. + const CONS_UPROC = 0; // Release has not been processed. + const REQID_FOUND = 1; // Request ID found and release was updated. + function __construct($echooutput = false) { @@ -586,11 +592,12 @@ class Konsole $result = array(); // Get name of the game from name of release. - preg_match('/^(.+((abgx360EFNet|EFNet\sFULL|FULL\sabgxEFNet|abgx\sFULL|abgxbox360EFNet)\s|illuminatenboard\sorg))?(?P.*?)[\.\-_ ](v\.?\d\.\d|PAL|NTSC|EUR|USA|JP|ASIA|JAP|JPN|AUS|MULTI\.?5|MULTI\.?4|MULTI\.?3|PATCHED|FULLDVD|DVD5|DVD9|DVDRIP|PROPER|REPACK|RETAIL|DEMO|DISTRIBUTION|REGIONFREE|READ\.?NFO|NFOFIX|PS2|PS3|PSP|WII|X\-?BOX|XBLA|X360|NDS|N64|NGC)/i', $releasename, $matches); + preg_match('/^(.+((abgx360EFNet|EFNet\sFULL|FULL\sabgxEFNet|abgx\sFULL|abgxbox360EFNet)\s|illuminatenboard\sorg|\(\d+\)))?(?P<title>.*?)[\.\-_ \:](v\.?\d\.\d|PAL|NTSC|EUR|USA|JP|ASIA|JAP|JPN|AUS|MULTI(\.?\d{1,2})?|PATCHED|FULLDVD|DVD5|DVD9|DVDRIP|PROPER|REPACK|RETAIL|DEMO|DISTRIBUTION|REGIONFREE|[\. ]RF[\. ]?|READ\.?NFO|NFOFIX|PS2|PS3|PSP|WII|X\-?BOX|XBLA|X360|3DS|NDS|N64|NGC)/i', $releasename, $matches); if (isset($matches['title'])) { $title = $matches['title']; // Replace dots or underscores with spaces. $result['title'] = preg_replace('/(\.|_|\%20)/', ' ', $title); + $result['title'] = str_replace(' RF ', ' ', $result['title']); // Needed to add code to handle DLC Properly. if (preg_match('/dlc/i', $result['title'])) { $result['dlc'] = '1'; diff --git a/lib/copy_this/www/lib/users.php b/lib/copy_this/www/lib/users.php index 877aa5aa9..21d36a9e7 100644 --- a/lib/copy_this/www/lib/users.php +++ b/lib/copy_this/www/lib/users.php @@ -201,13 +201,8 @@ class Users $sql[] = sprintf('nzbgeturl = %s', $db->escapeString($nzbgetURL)); } - if ($nzbgetUsername !== '') { - $sql[] = sprintf('nzbgetusername = %s', $db->escapeString($nzbgetUsername)); - } - - if ($nzbgetPassword !== '') { - $sql[] = sprintf('nzbgetpassword = %s', $db->escapeString($nzbgetPassword)); - } + $sql[] = sprintf('nzbgetusername = %s', $db->escapeString($nzbgetUsername)); + $sql[] = sprintf('nzbgetpassword = %s', $db->escapeString($nzbgetPassword)); if ($saburl !== '') { $sql[] = sprintf('saburl = %s', $db->escapeString($saburl)); diff --git a/lib/prehash.php b/lib/prehash.php index 96bda8850..fd0ed1cfe 100644 --- a/lib/prehash.php +++ b/lib/prehash.php @@ -121,7 +121,7 @@ Class PreHash } } - if (self::PRE_OMGWTF) { + /*if (self::PRE_OMGWTF) { $this->updatedPre = $this->insertedPre = 0; $this->retrieveOmgwtfnzbs(); $newPre += $this->insertedPre; @@ -130,9 +130,9 @@ Class PreHash echo $this->c->primary($this->insertedPre . " \tRetrieved from Omgwtfnzbs."); echo $this->c->primary($this->updatedPre . " \tUpdated from Omgwtfnzbs."); } - } + }*/ - if (self::PRE_ZENET) { + /*if (self::PRE_ZENET) { $this->updatedPre = $this->insertedPre = 0; $this->retrieveZenet(); $newPre += $this->insertedPre; @@ -141,9 +141,9 @@ Class PreHash echo $this->c->primary($this->insertedPre . " \tRetrieved from Zenet."); echo $this->c->primary($this->updatedPre . " \tUpdated from Zenet."); } - } + }*/ - if (self::PRE_PRELIST) { + /*if (self::PRE_PRELIST) { $this->updatedPre = $this->insertedPre = 0; $this->retrievePrelist(); $newPre += $this->insertedPre; @@ -152,9 +152,9 @@ Class PreHash echo $this->c->primary($this->insertedPre . " \tRetrieved from Prelist."); echo $this->c->primary($this->updatedPre . " \tUpdated from Prelist."); } - } + }*/ - if (self::PRE_ORLYDB) { + /*if (self::PRE_ORLYDB) { $this->updatedPre = $this->insertedPre = 0; $this->retrieveOrlydb(); $newPre += $this->insertedPre; @@ -163,9 +163,9 @@ Class PreHash echo $this->c->primary($this->insertedPre . " \tRetrieved from Orlydb."); echo $this->c->primary($this->updatedPre . " \tUpdated from Orlydb."); } - } + }*/ - if (self::PRE_SRRDB) { + /*if (self::PRE_SRRDB) { $this->updatedPre = $this->insertedPre = 0; $this->retrieveSrr(); $newPre += $this->insertedPre; @@ -174,7 +174,7 @@ Class PreHash echo $this->c->primary($this->insertedPre . " \tRetrieved from Srrdb."); echo $this->c->primary($this->updatedPre . " \tUpdated from Srrdb."); } - } + }*/ if (self::PRE_PREDBME) { $this->updatedPre = $this->insertedPre = 0; @@ -889,7 +889,8 @@ Class PreHash // To save space in the DB we do this instead of storing the full URL. if ($URL === 'srrdb') { - $URL = 'http://www.srrdb.com/download/file/' . $row['title'] . '/' . strtolower(urlencode($row['title'])) . '.nfo'; + continue; + //$URL = 'http://www.srrdb.com/download/file/' . $row['title'] . '/' . strtolower(urlencode($row['title'])) . '.nfo'; } $buffer = $this->getUrl($URL); @@ -899,9 +900,9 @@ Class PreHash continue; } - if ($row['nfo'] === 'srrdb' && preg_match('/You\'ve reached the daily limit/i', $buffer)) { + /*if ($row['nfo'] === 'srrdb' && preg_match('/You\'ve reached the daily limit/i', $buffer)) { continue; - } + }*/ if ($nfo->addAlternateNfo($buffer, $row, $nntp)) { if ($this->echooutput) {