status)) return $json->error; else return $json->warnings; } function apacheModuleLoaded($modName) { $modules = apache_get_modules(); return in_array($modName, $modules); } $loadedArr['isPHP_5_2_3'] = version_compare(PHP_VERSION, '5.2.3', '>='); $loadedArr['curlLoaded'] = extension_loaded('curl'); $loadedArr['mcryptLoaded'] = extension_loaded('mcrypt'); $loadedArr['gdLoaded'] = function_exists('gd_info'); $loadedArr['pdoLoaded'] = class_exists('PDO'); $loadedArr['splLoaded'] = function_exists('spl_autoload_register'); $loadedArr['reflectionLoaded'] = class_exists('ReflectionClass'); $loadedArr['filterLoaded'] = function_exists('filter_list'); $loadedArr['iconvLoaded'] = extension_loaded('iconv'); $loadedArr['mbstringLoadeed'] = extension_loaded('mbstring'); $loadedArr['systemDir'] = is_dir(SYSPATH) AND is_file(SYSPATH.'classes/kohana'.EXT); $loadedArr['applicationDir'] = is_file(APPPATH.'bootstrap'.EXT); $loadedArr['cacheDir'] = is_dir(APPPATH.'cache') AND is_writable(APPPATH.'cache'); $loadedArr['logsDir'] = is_dir(APPPATH.'logs') AND is_writable(APPPATH.'logs'); $loadedArr['configDir'] = is_dir(APPPATH.'config') AND is_writable(APPPATH.'config'); if (is_dir(realpath(APPPATH.'../images')) AND is_writable(realpath(APPPATH.'../images')) AND is_writable(realpath(APPPATH.'../images/__cache')) AND is_writable(realpath(APPPATH.'../images/banner')) AND is_writable(realpath(APPPATH.'../images/poster')) AND is_writable(realpath(APPPATH.'../images/fanart'))) { $loadedArr['imagesDir'] = true; } else { $loadedArr['imagesDir'] = false; } $loadedArr['modeRewriteLoded'] = apacheModuleLoaded('mod_rewrite'); $requestUri = preg_replace('/\/index.php/', '', $_SERVER['REQUEST_URI']); $requestUri = '/' . trim($requestUri, '/') . '/'; $loadedArr['requestUri'] = ($requestUri == '/autoTvToSab/'); $loadedArr['utf8Support'] = @preg_match('/^.$/u', 'ñ'); $loadedArr['unicodeSupport'] = @preg_match('/^\pL$/u', 'ñ'); $loadedArr['URI_Determination'] = isset($_SERVER['REQUEST_URI']) OR isset($_SERVER['PHP_SELF']) OR isset($_SERVER['PATH_INFO']); $errorMsg = array(); $configSaved = false; if (filter_has_var(INPUT_GET, 'save')) { // var_dump($_GET); $defs = array( 'series_autocomplete' => FILTER_SANITIZE_STRING, 'use_nzb_site' => FILTER_SANITIZE_STRING, 'nzbs_query_string' => FILTER_SANITIZE_STRING, 'matrix_api_key' => FILTER_SANITIZE_STRING, 'matrix_api_user' => FILTER_SANITIZE_STRING, 'thetvdb_api_key' => FILTER_SANITIZE_STRING, 'sab_api_key' => FILTER_SANITIZE_STRING, 'rss_how_old' => array('filter'=>FILTER_SANITIZE_STRING, 'options' => array('min_range' => 4, 'max_range' => 20)), 'sab_url' => FILTER_VALIDATE_URL, 'rss_num_results' => FILTER_VALIDATE_INT, 'db_host' => FILTER_DEFAULT, 'db_user' => FILTER_DEFAULT, 'db_pass' => FILTER_DEFAULT, 'db_dbname' => FILTER_DEFAULT, ); $get = filter_input_array(INPUT_GET, $defs); $link = @mysql_connect($get['db_host'], $get['db_user'], $get['db_pass']); if (!$link) { $errorMsg[] = "Can not login to the database. Check the login data to the database are correct : " . mysql_error(); } $db_selected = @mysql_select_db($get['db_dbname'], $link); if (!$db_selected) { $errorMsg[] = 'Can\'t use "'.$get['db_dbname'].'" as a database : ' . mysql_error(); } if (!testSab($get['sab_url'])) { $errorMsg[] = "Incorrect URL: {$get['sab_url']}"; } $SabWarnings = getWarnings($get['sab_url'], $get['sab_api_key']); if (is_string($SabWarnings)) { $errorMsg[] = "SABnzbd error: $SabWarnings"; } if (!in_array(false, $loadedArr, true) && !in_array(null, $get, true) && !in_array(false, $get, true) && empty($errorMsg)) { $config = " false, 'default' => array( 'saveImagesAsNew' => false, 'cacheTimeImages' => (3600 * 3), 'TheTvDB_api_key' => '{$get['thetvdb_api_key']}', 'NzbMatrix_api_key' => '{$get['matrix_api_key']}', 'NzbMatrix_api_user' => '{$get['matrix_api_user']}', 'useNzbSite' => '{$get['use_nzb_site']}', //nzbs ), 'Sabnzbd' => array( 'api_key' => '{$get['sab_api_key']}', 'url' => '{$get['sab_url']}', ), 'rss' => array( 'numberOfResults' => {$get['rss_num_results']}, 'howOld' => '{$get['rss_how_old']}' //\"-1 week\" \"-2 days\" \"-4 hours\" \"-2 seconds\" uses strtotime() ), 'nzbs' => array( 'queryString' => '{$get['nzbs_query_string']}' ), ); ?>"; file_put_contents('application/config/default.php', $config); $get['db_pass'] = (empty($get['db_pass'])) ? "FALSE": "'{$get['db_pass']}'"; $config = " array ( 'type' => 'mysql', 'connection' => array( /** * The following options are available for MySQL: * * string hostname * string username * string password * boolean persistent * string database * * Ports and sockets may be appended to the hostname. */ 'hostname' => '{$get['db_host']}', 'username' => '{$get['db_user']}', 'password' => {$get['db_pass']}, 'persistent' => FALSE, 'database' => '{$get['db_dbname']}', ), 'table_prefix' => '', 'charset' => 'utf8', 'caching' => FALSE, 'profiling' => TRUE, ), 'alternate' => array( 'type' => 'pdo', 'connection' => array( /** * The following options are available for PDO: * * string dsn * string username * string password * boolean persistent * string identifier */ 'dsn' => 'mysql:host=localhost;dbname=kohana', 'username' => 'root', 'password' => 'r00tdb', 'persistent' => FALSE, ), 'table_prefix' => '', 'charset' => 'utf8', 'caching' => FALSE, 'profiling' => TRUE, ), );"; file_put_contents('application/config/database.php', $config); $configSaved = true; } } ?> AutoTvToSab Installation

✔ Your environment passed all requirements.
Remove or rename the install file now.

SABnzbd errors:

Fields marked in red are important

Follow the instructions here before continuing.

You have an error in the installation form

  1. Databas variables 1

  2. Set Sabnzbd variables 2

  3. Set NZB site variables 3

    Use NZB Matrix Use NZBs.org Use Both
    If you dont have an VIP account on Nzbmatrix.com click here and register for one
  4. Set Thetvdb.com variables 4

    If you dont have an account on Thetvdb.com click here and register for one
  5. RSS variables 5

    Do not touch unless you know what you are doing

    Example: -1 week or -4 hours
  6. Environment Tests 6

    The following tests have been run to determine if AutoTvToSab will work in your environment.

    PHP Version AutoTvToSab requires PHP 5.2.3 or newer, this version is .
    System Directory The configured system directory does not exist or does not contain required files.
    Application Directory The configured application directory does not exist or does not contain required files.
    Cache Directory The directory is not writable.
    Logs Directory The directory is not writable.
    Config Directory The directory is not writable.
    Images Directory The directory or it´s subdirectories is not writable.
    PCRE UTF-8 PCRE has not been compiled with UTF-8 support. PCRE has not been compiled with Unicode property support. Pass
    SPL Enabled Pass PHP SPL is either not loaded or not compiled in.
    Reflection Enabled Pass PHP reflection is either not loaded or not compiled in.
    Filters Enabled Pass The filter extension is either not loaded or not compiled in.
    Iconv Extension Loaded Pass The iconv extension is not loaded.
    Mbstring Not Overloaded The mbstring extension is overloading PHP's native string functions. Pass
    URI Determination Pass Neither $_SERVER['REQUEST_URI'], $_SERVER['PHP_SELF'], or $_SERVER['PATH_INFO'] is available.
    cURL Enabled Pass AutoTvToSab requires cURL for the Remote class.
    GD Enabled Pass AutoTvToSab requires GD v2 for the Image class.
    Base url Pass AutoTvToSab requires this line 'base_url' => '/autoTvToSab/', in application/bootstrap.php to be set to 'base_url' => ''.
    Optional
    Apache mod_rewrite Pass AutoTvToSab requires mod_rewrite to rewrite requested URLs on the fly. You can use autoTvToSab without mod_rewrite. But then you must change this line 'index_file' => FALSE, in application/bootstrap.php to 'index_file' => 'index.php', and delete the .htaccess file.
    mcrypt Enabled Pass AutoTvToSab requires mcrypt for the Encrypt class.
    PDO Enabled Pass AutoTvToSab can use PDO to support additional databases.

    ✘ AutoTvToSab may not work correctly with your environment.

Collapse all