2014-03-10 01:18:05 -04:00
|
|
|
# Author: Nic Wolfe <nic@wolfeden.ca>
|
|
|
|
# URL: http://code.google.com/p/sickbeard/
|
|
|
|
#
|
2014-05-23 08:37:22 -04:00
|
|
|
# This file is part of SickRage.
|
2014-03-10 01:18:05 -04:00
|
|
|
#
|
2014-05-23 08:37:22 -04:00
|
|
|
# SickRage is free software: you can redistribute it and/or modify
|
2014-03-10 01:18:05 -04:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
2014-05-23 08:37:22 -04:00
|
|
|
# SickRage is distributed in the hope that it will be useful,
|
2014-03-10 01:18:05 -04:00
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2014-05-23 02:42:11 -04:00
|
|
|
# GNU General Public License for more details.
|
2014-03-10 01:18:05 -04:00
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2014-05-23 08:37:22 -04:00
|
|
|
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
|
2014-04-23 03:26:10 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
from __future__ import with_statement
|
|
|
|
|
|
|
|
import webbrowser
|
|
|
|
import datetime
|
|
|
|
import socket
|
2014-06-30 09:18:02 -04:00
|
|
|
import os
|
|
|
|
import re
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
from threading import Lock
|
|
|
|
|
|
|
|
# apparently py2exe won't build these unless they're imported somewhere
|
2014-07-02 14:51:14 -04:00
|
|
|
import sys
|
2014-06-15 03:16:55 -04:00
|
|
|
from sickbeard import providers, metadata, config, webserveInit
|
2014-05-17 01:23:11 -04:00
|
|
|
from sickbeard.providers.generic import GenericProvider
|
2014-06-06 16:48:25 -04:00
|
|
|
from providers import ezrss, tvtorrents, btn, newznab, womble, thepiratebay, torrentleech, kat, iptorrents, \
|
2014-07-27 06:59:21 -04:00
|
|
|
omgwtfnzbs, scc, hdtorrents, torrentday, hdbits, nextgen, speedcd, nyaatorrents, fanzub, torrentbytes, animezb, \
|
2014-09-11 13:26:17 -04:00
|
|
|
freshontv, bitsoup, t411, tokyotoshokan
|
2014-05-17 01:23:11 -04:00
|
|
|
from sickbeard.config import CheckSection, check_setting_int, check_setting_str, check_setting_float, ConfigMigrator, \
|
|
|
|
naming_ep_type
|
2014-05-11 08:49:07 -04:00
|
|
|
from sickbeard import searchBacklog, showUpdater, versionChecker, properFinder, autoPostProcesser, \
|
2014-06-28 23:28:00 -04:00
|
|
|
subtitles, traktChecker
|
2014-03-12 01:28:30 -04:00
|
|
|
from sickbeard import helpers, db, exceptions, show_queue, search_queue, scheduler, show_name_helpers
|
2014-03-10 01:18:05 -04:00
|
|
|
from sickbeard import logger
|
|
|
|
from sickbeard import naming
|
2014-05-15 00:16:46 -04:00
|
|
|
from sickbeard import dailysearcher
|
2014-04-30 18:07:18 -04:00
|
|
|
from sickbeard import scene_numbering, scene_exceptions, name_cache
|
2014-03-25 01:57:24 -04:00
|
|
|
from indexers.indexer_api import indexerApi
|
|
|
|
from indexers.indexer_exceptions import indexer_shownotfound, indexer_exception, indexer_error, indexer_episodenotfound, \
|
|
|
|
indexer_attributenotfound, indexer_seasonnotfound, indexer_userabort, indexerExcepts
|
2014-05-21 16:26:24 -04:00
|
|
|
from sickbeard.common import SD, SKIPPED, NAMING_REPEAT
|
2014-03-10 01:18:05 -04:00
|
|
|
from sickbeard.databases import mainDB, cache_db, failed_db
|
|
|
|
|
|
|
|
from lib.configobj import ConfigObj
|
2014-05-13 11:44:31 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
PID = None
|
|
|
|
|
|
|
|
CFG = None
|
|
|
|
CONFIG_FILE = None
|
|
|
|
|
|
|
|
# This is the version of the config we EXPECT to find
|
|
|
|
CONFIG_VERSION = 5
|
|
|
|
|
|
|
|
# Default encryption version (0 for None)
|
|
|
|
ENCRYPTION_VERSION = 0
|
|
|
|
|
|
|
|
PROG_DIR = '.'
|
|
|
|
MY_FULLNAME = None
|
|
|
|
MY_NAME = None
|
|
|
|
MY_ARGS = []
|
|
|
|
SYS_ENCODING = ''
|
|
|
|
DATA_DIR = ''
|
|
|
|
CREATEPID = False
|
|
|
|
PIDFILE = ''
|
|
|
|
|
|
|
|
DAEMON = None
|
2014-06-11 04:34:28 -04:00
|
|
|
NO_RESIZE = False
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-07-08 18:17:34 -04:00
|
|
|
# system events
|
|
|
|
events = None
|
|
|
|
|
2014-05-15 00:16:46 -04:00
|
|
|
dailySearchScheduler = None
|
2014-03-10 01:18:05 -04:00
|
|
|
backlogSearchScheduler = None
|
|
|
|
showUpdateScheduler = None
|
|
|
|
versionCheckScheduler = None
|
|
|
|
showQueueScheduler = None
|
|
|
|
searchQueueScheduler = None
|
|
|
|
properFinderScheduler = None
|
2014-06-11 04:34:28 -04:00
|
|
|
autoPostProcesserScheduler = None
|
2014-03-10 01:18:05 -04:00
|
|
|
subtitlesFinderScheduler = None
|
2014-06-28 23:28:00 -04:00
|
|
|
traktCheckerScheduler = None
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
showList = None
|
|
|
|
loadingShowList = None
|
|
|
|
|
2014-06-30 09:18:02 -04:00
|
|
|
providerList = []
|
|
|
|
newznabProviderList = []
|
|
|
|
torrentRssProviderList = []
|
|
|
|
metadata_provider_dict = {}
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
NEWEST_VERSION = None
|
|
|
|
NEWEST_VERSION_STRING = None
|
2014-07-27 06:59:21 -04:00
|
|
|
VERSION_NOTIFY = False
|
|
|
|
AUTO_UPDATE = False
|
|
|
|
NOTIFY_ON_UPDATE = False
|
2014-05-04 18:49:40 -04:00
|
|
|
CUR_COMMIT_HASH = None
|
2014-07-30 20:19:44 -04:00
|
|
|
BRANCH = ''
|
2014-08-17 20:15:02 -04:00
|
|
|
CUR_COMMIT_BRANCH = ''
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
INIT_LOCK = Lock()
|
|
|
|
started = False
|
|
|
|
|
|
|
|
ACTUAL_LOG_DIR = None
|
|
|
|
LOG_DIR = None
|
|
|
|
|
|
|
|
SOCKET_TIMEOUT = None
|
|
|
|
|
|
|
|
WEB_PORT = None
|
|
|
|
WEB_LOG = None
|
|
|
|
WEB_ROOT = None
|
|
|
|
WEB_USERNAME = None
|
|
|
|
WEB_PASSWORD = None
|
|
|
|
WEB_HOST = None
|
|
|
|
WEB_IPV6 = None
|
|
|
|
|
2014-07-27 06:59:21 -04:00
|
|
|
PLAY_VIDEOS = False
|
2014-07-11 07:05:33 -04:00
|
|
|
|
2014-07-27 06:59:21 -04:00
|
|
|
HANDLE_REVERSE_PROXY = False
|
2014-04-25 07:11:52 -04:00
|
|
|
PROXY_SETTING = None
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
LOCALHOST_IP = None
|
2014-05-17 07:40:26 -04:00
|
|
|
|
|
|
|
CPU_PRESET = None
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
ANON_REDIRECT = None
|
|
|
|
|
|
|
|
USE_API = False
|
|
|
|
API_KEY = None
|
|
|
|
|
|
|
|
ENABLE_HTTPS = False
|
|
|
|
HTTPS_CERT = None
|
|
|
|
HTTPS_KEY = None
|
|
|
|
|
2014-07-27 06:59:21 -04:00
|
|
|
LAUNCH_BROWSER = False
|
2014-03-10 01:18:05 -04:00
|
|
|
CACHE_DIR = None
|
|
|
|
ACTUAL_CACHE_DIR = None
|
|
|
|
ROOT_DIRS = None
|
2014-07-27 06:59:21 -04:00
|
|
|
UPDATE_SHOWS_ON_START = False
|
|
|
|
SORT_ARTICLE = False
|
2014-04-28 18:22:44 -04:00
|
|
|
DEBUG = False
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-07-27 06:59:21 -04:00
|
|
|
USE_LISTVIEW = False
|
2014-03-10 01:18:05 -04:00
|
|
|
METADATA_XBMC = None
|
|
|
|
METADATA_XBMC_12PLUS = None
|
|
|
|
METADATA_MEDIABROWSER = None
|
|
|
|
METADATA_PS3 = None
|
|
|
|
METADATA_WDTV = None
|
|
|
|
METADATA_TIVO = None
|
2014-05-11 19:15:24 -04:00
|
|
|
METADATA_MEDE8ER = None
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
QUALITY_DEFAULT = None
|
|
|
|
STATUS_DEFAULT = None
|
2014-07-27 06:59:21 -04:00
|
|
|
FLATTEN_FOLDERS_DEFAULT = False
|
|
|
|
SUBTITLES_DEFAULT = False
|
2014-04-27 04:17:28 -04:00
|
|
|
INDEXER_DEFAULT = None
|
2014-05-21 14:17:52 -04:00
|
|
|
INDEXER_TIMEOUT = None
|
2014-07-27 06:59:21 -04:00
|
|
|
SCENE_DEFAULT = False
|
|
|
|
ANIME_DEFAULT = False
|
2014-06-30 09:18:02 -04:00
|
|
|
PROVIDER_ORDER = []
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-07-27 06:59:21 -04:00
|
|
|
NAMING_MULTI_EP = False
|
2014-03-10 01:18:05 -04:00
|
|
|
NAMING_PATTERN = None
|
|
|
|
NAMING_ABD_PATTERN = None
|
2014-07-27 06:59:21 -04:00
|
|
|
NAMING_CUSTOM_ABD = False
|
2014-04-28 05:15:29 -04:00
|
|
|
NAMING_SPORTS_PATTERN = None
|
2014-07-27 06:59:21 -04:00
|
|
|
NAMING_CUSTOM_SPORTS = False
|
2014-03-10 01:18:05 -04:00
|
|
|
NAMING_FORCE_FOLDERS = False
|
2014-07-27 06:59:21 -04:00
|
|
|
NAMING_STRIP_YEAR = False
|
2014-05-26 02:29:22 -04:00
|
|
|
NAMING_ANIME = None
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-07-27 06:59:21 -04:00
|
|
|
USE_NZBS = False
|
|
|
|
USE_TORRENTS = False
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
NZB_METHOD = None
|
|
|
|
NZB_DIR = None
|
|
|
|
USENET_RETENTION = None
|
|
|
|
TORRENT_METHOD = None
|
|
|
|
TORRENT_DIR = None
|
2014-07-27 06:59:21 -04:00
|
|
|
DOWNLOAD_PROPERS = False
|
2014-05-14 18:23:59 -04:00
|
|
|
CHECK_PROPERS_INTERVAL = None
|
2014-07-27 06:59:21 -04:00
|
|
|
ALLOW_HIGH_PRIORITY = False
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-05-21 16:26:24 -04:00
|
|
|
AUTOPOSTPROCESSER_FREQUENCY = None
|
2014-05-15 00:16:46 -04:00
|
|
|
DAILYSEARCH_FREQUENCY = None
|
2014-04-26 17:24:29 -04:00
|
|
|
UPDATE_FREQUENCY = None
|
2014-05-17 12:18:50 -04:00
|
|
|
BACKLOG_FREQUENCY = None
|
2014-07-27 06:59:21 -04:00
|
|
|
DAILYSEARCH_STARTUP = False
|
|
|
|
BACKLOG_STARTUP = False
|
2014-04-26 17:24:29 -04:00
|
|
|
|
2014-05-21 16:26:24 -04:00
|
|
|
MIN_AUTOPOSTPROCESSER_FREQUENCY = 1
|
2014-08-25 03:39:21 -04:00
|
|
|
MIN_BACKLOG_FREQUENCY = 1440
|
2014-05-17 12:18:50 -04:00
|
|
|
MIN_DAILYSEARCH_FREQUENCY = 10
|
2014-04-27 08:22:48 -04:00
|
|
|
MIN_UPDATE_FREQUENCY = 1
|
2014-05-21 16:26:24 -04:00
|
|
|
DEFAULT_AUTOPOSTPROCESSER_FREQUENCY = 10
|
2014-05-17 12:18:50 -04:00
|
|
|
DEFAULT_BACKLOG_FREQUENCY = 10080
|
2014-05-17 14:14:48 -04:00
|
|
|
DEFAULT_DAILYSEARCH_FREQUENCY = 60
|
2014-05-17 12:18:50 -04:00
|
|
|
DEFAULT_UPDATE_FREQUENCY = 1
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-07-27 06:59:21 -04:00
|
|
|
ADD_SHOWS_WO_DIR = False
|
|
|
|
CREATE_MISSING_SHOW_DIRS = False
|
2014-03-10 01:18:05 -04:00
|
|
|
RENAME_EPISODES = False
|
2014-05-14 08:33:36 -04:00
|
|
|
AIRDATE_EPISODES = False
|
2014-03-10 01:18:05 -04:00
|
|
|
PROCESS_AUTOMATICALLY = False
|
|
|
|
KEEP_PROCESSED_DIR = False
|
|
|
|
PROCESS_METHOD = None
|
|
|
|
MOVE_ASSOCIATED_FILES = False
|
2014-09-07 06:45:19 -04:00
|
|
|
POSTPONE_IF_SYNC_FILES = True
|
2014-04-06 12:25:46 -04:00
|
|
|
NFO_RENAME = True
|
2014-03-10 01:18:05 -04:00
|
|
|
TV_DOWNLOAD_DIR = None
|
|
|
|
UNPACK = False
|
2014-05-17 18:14:31 -04:00
|
|
|
SKIP_REMOVED_FILES = False
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
NZBS = False
|
|
|
|
NZBS_UID = None
|
|
|
|
NZBS_HASH = None
|
|
|
|
|
|
|
|
WOMBLE = False
|
|
|
|
|
|
|
|
OMGWTFNZBS = False
|
|
|
|
OMGWTFNZBS_USERNAME = None
|
|
|
|
OMGWTFNZBS_APIKEY = None
|
|
|
|
|
|
|
|
NEWZBIN = False
|
|
|
|
NEWZBIN_USERNAME = None
|
|
|
|
NEWZBIN_PASSWORD = None
|
|
|
|
|
|
|
|
SAB_USERNAME = None
|
|
|
|
SAB_PASSWORD = None
|
|
|
|
SAB_APIKEY = None
|
|
|
|
SAB_CATEGORY = None
|
|
|
|
SAB_HOST = ''
|
|
|
|
|
2014-03-25 01:57:24 -04:00
|
|
|
NZBGET_USERNAME = None
|
2014-03-10 01:18:05 -04:00
|
|
|
NZBGET_PASSWORD = None
|
|
|
|
NZBGET_CATEGORY = None
|
|
|
|
NZBGET_HOST = None
|
2014-05-05 18:48:28 -04:00
|
|
|
NZBGET_USE_HTTPS = False
|
2014-08-11 16:07:02 -04:00
|
|
|
NZBGET_PRIORITY = 100
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
TORRENT_USERNAME = None
|
|
|
|
TORRENT_PASSWORD = None
|
|
|
|
TORRENT_HOST = ''
|
|
|
|
TORRENT_PATH = ''
|
2014-05-12 03:05:16 -04:00
|
|
|
TORRENT_SEED_TIME = None
|
2014-03-10 01:18:05 -04:00
|
|
|
TORRENT_PAUSED = False
|
|
|
|
TORRENT_HIGH_BANDWIDTH = False
|
|
|
|
TORRENT_LABEL = ''
|
2014-07-27 06:59:21 -04:00
|
|
|
TORRENT_VERIFY_CERT = False
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
USE_XBMC = False
|
2014-05-08 11:54:43 -04:00
|
|
|
XBMC_ALWAYS_ON = True
|
2014-03-10 01:18:05 -04:00
|
|
|
XBMC_NOTIFY_ONSNATCH = False
|
|
|
|
XBMC_NOTIFY_ONDOWNLOAD = False
|
|
|
|
XBMC_NOTIFY_ONSUBTITLEDOWNLOAD = False
|
|
|
|
XBMC_UPDATE_LIBRARY = False
|
|
|
|
XBMC_UPDATE_FULL = False
|
|
|
|
XBMC_UPDATE_ONLYFIRST = False
|
|
|
|
XBMC_HOST = ''
|
|
|
|
XBMC_USERNAME = None
|
|
|
|
XBMC_PASSWORD = None
|
|
|
|
|
|
|
|
USE_PLEX = False
|
|
|
|
PLEX_NOTIFY_ONSNATCH = False
|
|
|
|
PLEX_NOTIFY_ONDOWNLOAD = False
|
|
|
|
PLEX_NOTIFY_ONSUBTITLEDOWNLOAD = False
|
|
|
|
PLEX_UPDATE_LIBRARY = False
|
|
|
|
PLEX_SERVER_HOST = None
|
|
|
|
PLEX_HOST = None
|
|
|
|
PLEX_USERNAME = None
|
|
|
|
PLEX_PASSWORD = None
|
|
|
|
|
|
|
|
USE_GROWL = False
|
|
|
|
GROWL_NOTIFY_ONSNATCH = False
|
|
|
|
GROWL_NOTIFY_ONDOWNLOAD = False
|
|
|
|
GROWL_NOTIFY_ONSUBTITLEDOWNLOAD = False
|
|
|
|
GROWL_HOST = ''
|
|
|
|
GROWL_PASSWORD = None
|
|
|
|
|
|
|
|
USE_PROWL = False
|
|
|
|
PROWL_NOTIFY_ONSNATCH = False
|
|
|
|
PROWL_NOTIFY_ONDOWNLOAD = False
|
|
|
|
PROWL_NOTIFY_ONSUBTITLEDOWNLOAD = False
|
|
|
|
PROWL_API = None
|
|
|
|
PROWL_PRIORITY = 0
|
|
|
|
|
|
|
|
USE_TWITTER = False
|
|
|
|
TWITTER_NOTIFY_ONSNATCH = False
|
|
|
|
TWITTER_NOTIFY_ONDOWNLOAD = False
|
|
|
|
TWITTER_NOTIFY_ONSUBTITLEDOWNLOAD = False
|
|
|
|
TWITTER_USERNAME = None
|
|
|
|
TWITTER_PASSWORD = None
|
|
|
|
TWITTER_PREFIX = None
|
|
|
|
|
|
|
|
USE_BOXCAR = False
|
|
|
|
BOXCAR_NOTIFY_ONSNATCH = False
|
|
|
|
BOXCAR_NOTIFY_ONDOWNLOAD = False
|
|
|
|
BOXCAR_NOTIFY_ONSUBTITLEDOWNLOAD = False
|
|
|
|
BOXCAR_USERNAME = None
|
|
|
|
BOXCAR_PASSWORD = None
|
|
|
|
BOXCAR_PREFIX = None
|
|
|
|
|
2014-05-07 10:23:06 -04:00
|
|
|
USE_BOXCAR2 = False
|
|
|
|
BOXCAR2_NOTIFY_ONSNATCH = False
|
|
|
|
BOXCAR2_NOTIFY_ONDOWNLOAD = False
|
|
|
|
BOXCAR2_NOTIFY_ONSUBTITLEDOWNLOAD = False
|
|
|
|
BOXCAR2_ACCESSTOKEN = None
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
USE_PUSHOVER = False
|
|
|
|
PUSHOVER_NOTIFY_ONSNATCH = False
|
|
|
|
PUSHOVER_NOTIFY_ONDOWNLOAD = False
|
|
|
|
PUSHOVER_NOTIFY_ONSUBTITLEDOWNLOAD = False
|
|
|
|
PUSHOVER_USERKEY = None
|
2014-06-17 16:37:09 -04:00
|
|
|
PUSHOVER_APIKEY = None
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
USE_LIBNOTIFY = False
|
|
|
|
LIBNOTIFY_NOTIFY_ONSNATCH = False
|
|
|
|
LIBNOTIFY_NOTIFY_ONDOWNLOAD = False
|
|
|
|
LIBNOTIFY_NOTIFY_ONSUBTITLEDOWNLOAD = False
|
|
|
|
|
|
|
|
USE_NMJ = False
|
|
|
|
NMJ_HOST = None
|
|
|
|
NMJ_DATABASE = None
|
|
|
|
NMJ_MOUNT = None
|
|
|
|
|
2014-05-26 02:29:22 -04:00
|
|
|
ANIMESUPPORT = False
|
|
|
|
USE_ANIDB = False
|
|
|
|
ANIDB_USERNAME = None
|
|
|
|
ANIDB_PASSWORD = None
|
2014-07-27 06:59:21 -04:00
|
|
|
ANIDB_USE_MYLIST = False
|
2014-05-26 02:29:22 -04:00
|
|
|
ADBA_CONNECTION = None
|
|
|
|
ANIME_SPLIT_HOME = False
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
USE_SYNOINDEX = False
|
|
|
|
|
|
|
|
USE_NMJv2 = False
|
|
|
|
NMJv2_HOST = None
|
|
|
|
NMJv2_DATABASE = None
|
|
|
|
NMJv2_DBLOC = None
|
|
|
|
|
|
|
|
USE_SYNOLOGYNOTIFIER = False
|
|
|
|
SYNOLOGYNOTIFIER_NOTIFY_ONSNATCH = False
|
|
|
|
SYNOLOGYNOTIFIER_NOTIFY_ONDOWNLOAD = False
|
|
|
|
SYNOLOGYNOTIFIER_NOTIFY_ONSUBTITLEDOWNLOAD = False
|
|
|
|
|
|
|
|
USE_TRAKT = False
|
|
|
|
TRAKT_USERNAME = None
|
|
|
|
TRAKT_PASSWORD = None
|
|
|
|
TRAKT_API = ''
|
|
|
|
TRAKT_REMOVE_WATCHLIST = False
|
2014-08-08 19:07:17 -04:00
|
|
|
TRAKT_REMOVE_SERIESLIST = False
|
2014-03-10 01:18:05 -04:00
|
|
|
TRAKT_USE_WATCHLIST = False
|
|
|
|
TRAKT_METHOD_ADD = 0
|
|
|
|
TRAKT_START_PAUSED = False
|
2014-06-28 23:28:00 -04:00
|
|
|
TRAKT_USE_RECOMMENDED = False
|
2014-06-29 01:54:29 -04:00
|
|
|
TRAKT_SYNC = False
|
2014-07-24 00:44:11 -04:00
|
|
|
TRAKT_DEFAULT_INDEXER = None
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
USE_PYTIVO = False
|
|
|
|
PYTIVO_NOTIFY_ONSNATCH = False
|
|
|
|
PYTIVO_NOTIFY_ONDOWNLOAD = False
|
|
|
|
PYTIVO_NOTIFY_ONSUBTITLEDOWNLOAD = False
|
|
|
|
PYTIVO_UPDATE_LIBRARY = False
|
|
|
|
PYTIVO_HOST = ''
|
|
|
|
PYTIVO_SHARE_NAME = ''
|
|
|
|
PYTIVO_TIVO_NAME = ''
|
|
|
|
|
|
|
|
USE_NMA = False
|
|
|
|
NMA_NOTIFY_ONSNATCH = False
|
|
|
|
NMA_NOTIFY_ONDOWNLOAD = False
|
|
|
|
NMA_NOTIFY_ONSUBTITLEDOWNLOAD = False
|
|
|
|
NMA_API = None
|
|
|
|
NMA_PRIORITY = 0
|
|
|
|
|
|
|
|
USE_PUSHALOT = False
|
|
|
|
PUSHALOT_NOTIFY_ONSNATCH = False
|
|
|
|
PUSHALOT_NOTIFY_ONDOWNLOAD = False
|
|
|
|
PUSHALOT_NOTIFY_ONSUBTITLEDOWNLOAD = False
|
|
|
|
PUSHALOT_AUTHORIZATIONTOKEN = None
|
|
|
|
|
|
|
|
USE_PUSHBULLET = False
|
|
|
|
PUSHBULLET_NOTIFY_ONSNATCH = False
|
|
|
|
PUSHBULLET_NOTIFY_ONDOWNLOAD = False
|
|
|
|
PUSHBULLET_NOTIFY_ONSUBTITLEDOWNLOAD = False
|
|
|
|
PUSHBULLET_API = None
|
|
|
|
PUSHBULLET_DEVICE = None
|
|
|
|
|
|
|
|
USE_EMAIL = False
|
|
|
|
EMAIL_NOTIFY_ONSNATCH = False
|
|
|
|
EMAIL_NOTIFY_ONDOWNLOAD = False
|
|
|
|
EMAIL_NOTIFY_ONSUBTITLEDOWNLOAD = False
|
|
|
|
EMAIL_HOST = None
|
|
|
|
EMAIL_PORT = 25
|
|
|
|
EMAIL_TLS = False
|
|
|
|
EMAIL_USER = None
|
|
|
|
EMAIL_PASSWORD = None
|
|
|
|
EMAIL_FROM = None
|
|
|
|
EMAIL_LIST = None
|
|
|
|
|
|
|
|
GUI_NAME = None
|
|
|
|
HOME_LAYOUT = None
|
|
|
|
HISTORY_LAYOUT = None
|
2014-07-27 06:59:21 -04:00
|
|
|
DISPLAY_SHOW_SPECIALS = False
|
2014-03-10 01:18:05 -04:00
|
|
|
COMING_EPS_LAYOUT = None
|
2014-07-27 06:59:21 -04:00
|
|
|
COMING_EPS_DISPLAY_PAUSED = False
|
2014-03-10 01:18:05 -04:00
|
|
|
COMING_EPS_SORT = None
|
|
|
|
COMING_EPS_MISSED_RANGE = None
|
2014-05-23 11:20:44 -04:00
|
|
|
FUZZY_DATING = False
|
|
|
|
TRIM_ZERO = False
|
2014-03-10 01:18:05 -04:00
|
|
|
DATE_PRESET = None
|
|
|
|
TIME_PRESET = None
|
|
|
|
TIME_PRESET_W_SECONDS = None
|
2014-05-17 03:30:21 -04:00
|
|
|
TIMEZONE_DISPLAY = None
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
USE_SUBTITLES = False
|
2014-06-30 09:18:02 -04:00
|
|
|
SUBTITLES_LANGUAGES = []
|
2014-03-10 01:18:05 -04:00
|
|
|
SUBTITLES_DIR = ''
|
2014-06-30 09:18:02 -04:00
|
|
|
SUBTITLES_SERVICES_LIST = []
|
|
|
|
SUBTITLES_SERVICES_ENABLED = []
|
2014-03-10 01:18:05 -04:00
|
|
|
SUBTITLES_HISTORY = False
|
|
|
|
SUBTITLES_FINDER_FREQUENCY = 1
|
|
|
|
|
|
|
|
USE_FAILED_DOWNLOADS = False
|
|
|
|
DELETE_FAILED = False
|
|
|
|
|
2014-06-30 09:18:02 -04:00
|
|
|
EXTRA_SCRIPTS = []
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
GIT_PATH = None
|
|
|
|
|
|
|
|
IGNORE_WORDS = "german,french,core2hd,dutch,swedish,reenc,MrLss"
|
|
|
|
|
|
|
|
CALENDAR_UNPROTECTED = False
|
|
|
|
|
2014-03-13 08:20:45 -04:00
|
|
|
TMDB_API_KEY = 'edc5f123313769de83a71e157758030b'
|
2014-07-01 04:49:12 -04:00
|
|
|
TRAKT_API_KEY = 'abd806c54516240c76e4ebc9c5ccf394'
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-06-30 09:18:02 -04:00
|
|
|
__INITIALIZED__ = False
|
2014-07-27 06:59:21 -04:00
|
|
|
|
|
|
|
|
2014-03-25 01:57:24 -04:00
|
|
|
def initialize(consoleLogging=True):
|
2014-03-10 01:18:05 -04:00
|
|
|
with INIT_LOCK:
|
|
|
|
|
2014-08-17 20:15:02 -04:00
|
|
|
global BRANCH, CUR_COMMIT_HASH, CUR_COMMIT_BRANCH, ACTUAL_LOG_DIR, LOG_DIR, WEB_PORT, WEB_LOG, ENCRYPTION_VERSION, WEB_ROOT, WEB_USERNAME, WEB_PASSWORD, WEB_HOST, WEB_IPV6, USE_API, API_KEY, ENABLE_HTTPS, HTTPS_CERT, HTTPS_KEY, \
|
2014-05-19 19:43:01 -04:00
|
|
|
HANDLE_REVERSE_PROXY, USE_NZBS, USE_TORRENTS, NZB_METHOD, NZB_DIR, DOWNLOAD_PROPERS, CHECK_PROPERS_INTERVAL, ALLOW_HIGH_PRIORITY, TORRENT_METHOD, \
|
2014-03-25 01:57:24 -04:00
|
|
|
SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, SAB_HOST, \
|
2014-08-11 16:07:02 -04:00
|
|
|
NZBGET_USERNAME, NZBGET_PASSWORD, NZBGET_CATEGORY, NZBGET_PRIORITY, NZBGET_HOST, NZBGET_USE_HTTPS, backlogSearchScheduler, \
|
2014-05-20 12:27:52 -04:00
|
|
|
TORRENT_USERNAME, TORRENT_PASSWORD, TORRENT_HOST, TORRENT_PATH, TORRENT_SEED_TIME, TORRENT_PAUSED, TORRENT_HIGH_BANDWIDTH, TORRENT_LABEL, TORRENT_VERIFY_CERT, \
|
2014-05-08 11:54:43 -04:00
|
|
|
USE_XBMC, XBMC_ALWAYS_ON, XBMC_NOTIFY_ONSNATCH, XBMC_NOTIFY_ONDOWNLOAD, XBMC_NOTIFY_ONSUBTITLEDOWNLOAD, XBMC_UPDATE_FULL, XBMC_UPDATE_ONLYFIRST, \
|
2014-05-17 14:14:48 -04:00
|
|
|
XBMC_UPDATE_LIBRARY, XBMC_HOST, XBMC_USERNAME, XBMC_PASSWORD, BACKLOG_FREQUENCY, \
|
2014-08-11 07:29:35 -04:00
|
|
|
USE_TRAKT, TRAKT_USERNAME, TRAKT_PASSWORD, TRAKT_API, TRAKT_REMOVE_WATCHLIST, TRAKT_USE_WATCHLIST, TRAKT_METHOD_ADD, TRAKT_START_PAUSED, traktCheckerScheduler, TRAKT_USE_RECOMMENDED, TRAKT_SYNC, TRAKT_DEFAULT_INDEXER, TRAKT_REMOVE_SERIESLIST, \
|
2014-03-25 01:57:24 -04:00
|
|
|
USE_PLEX, PLEX_NOTIFY_ONSNATCH, PLEX_NOTIFY_ONDOWNLOAD, PLEX_NOTIFY_ONSUBTITLEDOWNLOAD, PLEX_UPDATE_LIBRARY, \
|
2014-05-17 18:14:31 -04:00
|
|
|
PLEX_SERVER_HOST, PLEX_HOST, PLEX_USERNAME, PLEX_PASSWORD, DEFAULT_BACKLOG_FREQUENCY, MIN_BACKLOG_FREQUENCY, BACKLOG_STARTUP, SKIP_REMOVED_FILES, \
|
2014-03-25 01:57:24 -04:00
|
|
|
showUpdateScheduler, __INITIALIZED__, LAUNCH_BROWSER, UPDATE_SHOWS_ON_START, SORT_ARTICLE, showList, loadingShowList, \
|
2014-05-21 14:17:52 -04:00
|
|
|
NEWZNAB_DATA, NZBS, NZBS_UID, NZBS_HASH, INDEXER_DEFAULT, INDEXER_TIMEOUT, USENET_RETENTION, TORRENT_DIR, \
|
2014-05-19 16:06:32 -04:00
|
|
|
QUALITY_DEFAULT, FLATTEN_FOLDERS_DEFAULT, SUBTITLES_DEFAULT, STATUS_DEFAULT, DAILYSEARCH_STARTUP, \
|
2014-03-25 01:57:24 -04:00
|
|
|
GROWL_NOTIFY_ONSNATCH, GROWL_NOTIFY_ONDOWNLOAD, GROWL_NOTIFY_ONSUBTITLEDOWNLOAD, TWITTER_NOTIFY_ONSNATCH, TWITTER_NOTIFY_ONDOWNLOAD, TWITTER_NOTIFY_ONSUBTITLEDOWNLOAD, \
|
|
|
|
USE_GROWL, GROWL_HOST, GROWL_PASSWORD, USE_PROWL, PROWL_NOTIFY_ONSNATCH, PROWL_NOTIFY_ONDOWNLOAD, PROWL_NOTIFY_ONSUBTITLEDOWNLOAD, PROWL_API, PROWL_PRIORITY, PROG_DIR, \
|
|
|
|
USE_PYTIVO, PYTIVO_NOTIFY_ONSNATCH, PYTIVO_NOTIFY_ONDOWNLOAD, PYTIVO_NOTIFY_ONSUBTITLEDOWNLOAD, PYTIVO_UPDATE_LIBRARY, PYTIVO_HOST, PYTIVO_SHARE_NAME, PYTIVO_TIVO_NAME, \
|
|
|
|
USE_NMA, NMA_NOTIFY_ONSNATCH, NMA_NOTIFY_ONDOWNLOAD, NMA_NOTIFY_ONSUBTITLEDOWNLOAD, NMA_API, NMA_PRIORITY, \
|
|
|
|
USE_PUSHALOT, PUSHALOT_NOTIFY_ONSNATCH, PUSHALOT_NOTIFY_ONDOWNLOAD, PUSHALOT_NOTIFY_ONSUBTITLEDOWNLOAD, PUSHALOT_AUTHORIZATIONTOKEN, \
|
|
|
|
USE_PUSHBULLET, PUSHBULLET_NOTIFY_ONSNATCH, PUSHBULLET_NOTIFY_ONDOWNLOAD, PUSHBULLET_NOTIFY_ONSUBTITLEDOWNLOAD, PUSHBULLET_API, PUSHBULLET_DEVICE, \
|
2014-07-03 03:16:15 -04:00
|
|
|
versionCheckScheduler, VERSION_NOTIFY, AUTO_UPDATE, NOTIFY_ON_UPDATE, PROCESS_AUTOMATICALLY, UNPACK, CPU_PRESET, \
|
2014-05-17 12:18:50 -04:00
|
|
|
KEEP_PROCESSED_DIR, PROCESS_METHOD, TV_DOWNLOAD_DIR, MIN_DAILYSEARCH_FREQUENCY, DEFAULT_UPDATE_FREQUENCY, MIN_UPDATE_FREQUENCY, UPDATE_FREQUENCY, \
|
2014-05-17 03:30:21 -04:00
|
|
|
showQueueScheduler, searchQueueScheduler, ROOT_DIRS, CACHE_DIR, ACTUAL_CACHE_DIR, TIMEZONE_DISPLAY, \
|
2014-04-28 05:15:29 -04:00
|
|
|
NAMING_PATTERN, NAMING_MULTI_EP, NAMING_FORCE_FOLDERS, NAMING_ABD_PATTERN, NAMING_CUSTOM_ABD, NAMING_SPORTS_PATTERN, NAMING_CUSTOM_SPORTS, NAMING_STRIP_YEAR, \
|
2014-06-11 04:34:28 -04:00
|
|
|
RENAME_EPISODES, AIRDATE_EPISODES, properFinderScheduler, PROVIDER_ORDER, autoPostProcesserScheduler, \
|
2014-03-25 01:57:24 -04:00
|
|
|
WOMBLE, OMGWTFNZBS, OMGWTFNZBS_USERNAME, OMGWTFNZBS_APIKEY, providerList, newznabProviderList, torrentRssProviderList, \
|
2014-05-15 00:16:46 -04:00
|
|
|
EXTRA_SCRIPTS, USE_TWITTER, TWITTER_USERNAME, TWITTER_PASSWORD, TWITTER_PREFIX, DAILYSEARCH_FREQUENCY, \
|
2014-03-25 01:57:24 -04:00
|
|
|
USE_BOXCAR, BOXCAR_USERNAME, BOXCAR_PASSWORD, BOXCAR_NOTIFY_ONDOWNLOAD, BOXCAR_NOTIFY_ONSUBTITLEDOWNLOAD, BOXCAR_NOTIFY_ONSNATCH, \
|
2014-05-07 10:23:06 -04:00
|
|
|
USE_BOXCAR2, BOXCAR2_ACCESSTOKEN, BOXCAR2_NOTIFY_ONDOWNLOAD, BOXCAR2_NOTIFY_ONSUBTITLEDOWNLOAD, BOXCAR2_NOTIFY_ONSNATCH, \
|
2014-06-17 16:37:09 -04:00
|
|
|
USE_PUSHOVER, PUSHOVER_USERKEY, PUSHOVER_APIKEY, PUSHOVER_NOTIFY_ONDOWNLOAD, PUSHOVER_NOTIFY_ONSUBTITLEDOWNLOAD, PUSHOVER_NOTIFY_ONSNATCH, \
|
2014-03-25 01:57:24 -04:00
|
|
|
USE_LIBNOTIFY, LIBNOTIFY_NOTIFY_ONSNATCH, LIBNOTIFY_NOTIFY_ONDOWNLOAD, LIBNOTIFY_NOTIFY_ONSUBTITLEDOWNLOAD, USE_NMJ, NMJ_HOST, NMJ_DATABASE, NMJ_MOUNT, USE_NMJv2, NMJv2_HOST, NMJv2_DATABASE, NMJv2_DBLOC, USE_SYNOINDEX, \
|
|
|
|
USE_SYNOLOGYNOTIFIER, SYNOLOGYNOTIFIER_NOTIFY_ONSNATCH, SYNOLOGYNOTIFIER_NOTIFY_ONDOWNLOAD, SYNOLOGYNOTIFIER_NOTIFY_ONSUBTITLEDOWNLOAD, \
|
|
|
|
USE_EMAIL, EMAIL_HOST, EMAIL_PORT, EMAIL_TLS, EMAIL_USER, EMAIL_PASSWORD, EMAIL_FROM, EMAIL_NOTIFY_ONSNATCH, EMAIL_NOTIFY_ONDOWNLOAD, EMAIL_NOTIFY_ONSUBTITLEDOWNLOAD, EMAIL_LIST, \
|
|
|
|
USE_LISTVIEW, METADATA_XBMC, METADATA_XBMC_12PLUS, METADATA_MEDIABROWSER, METADATA_PS3, metadata_provider_dict, \
|
2014-09-07 06:45:19 -04:00
|
|
|
NEWZBIN, NEWZBIN_USERNAME, NEWZBIN_PASSWORD, GIT_PATH, MOVE_ASSOCIATED_FILES, POSTPONE_IF_SYNC_FILES, dailySearchScheduler, NFO_RENAME, \
|
2014-05-23 11:20:44 -04:00
|
|
|
GUI_NAME, HOME_LAYOUT, HISTORY_LAYOUT, DISPLAY_SHOW_SPECIALS, COMING_EPS_LAYOUT, COMING_EPS_SORT, COMING_EPS_DISPLAY_PAUSED, COMING_EPS_MISSED_RANGE, FUZZY_DATING, TRIM_ZERO, DATE_PRESET, TIME_PRESET, TIME_PRESET_W_SECONDS, \
|
2014-05-11 19:15:24 -04:00
|
|
|
METADATA_WDTV, METADATA_TIVO, METADATA_MEDE8ER, IGNORE_WORDS, CALENDAR_UNPROTECTED, CREATE_MISSING_SHOW_DIRS, \
|
2014-03-25 01:57:24 -04:00
|
|
|
ADD_SHOWS_WO_DIR, USE_SUBTITLES, SUBTITLES_LANGUAGES, SUBTITLES_DIR, SUBTITLES_SERVICES_LIST, SUBTITLES_SERVICES_ENABLED, SUBTITLES_HISTORY, SUBTITLES_FINDER_FREQUENCY, subtitlesFinderScheduler, \
|
2014-06-29 23:58:34 -04:00
|
|
|
USE_FAILED_DOWNLOADS, DELETE_FAILED, ANON_REDIRECT, LOCALHOST_IP, TMDB_API_KEY, DEBUG, PROXY_SETTING, \
|
2014-05-26 02:29:22 -04:00
|
|
|
AUTOPOSTPROCESSER_FREQUENCY, DEFAULT_AUTOPOSTPROCESSER_FREQUENCY, MIN_AUTOPOSTPROCESSER_FREQUENCY, \
|
|
|
|
ANIME_DEFAULT, NAMING_ANIME, ANIMESUPPORT, USE_ANIDB, ANIDB_USERNAME, ANIDB_PASSWORD, ANIDB_USE_MYLIST, \
|
2014-07-11 07:05:33 -04:00
|
|
|
ANIME_SPLIT_HOME, SCENE_DEFAULT, PLAY_VIDEOS
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
if __INITIALIZED__:
|
|
|
|
return False
|
|
|
|
|
|
|
|
CheckSection(CFG, 'General')
|
|
|
|
CheckSection(CFG, 'Blackhole')
|
|
|
|
CheckSection(CFG, 'Newzbin')
|
|
|
|
CheckSection(CFG, 'SABnzbd')
|
|
|
|
CheckSection(CFG, 'NZBget')
|
|
|
|
CheckSection(CFG, 'XBMC')
|
|
|
|
CheckSection(CFG, 'PLEX')
|
|
|
|
CheckSection(CFG, 'Growl')
|
|
|
|
CheckSection(CFG, 'Prowl')
|
|
|
|
CheckSection(CFG, 'Twitter')
|
2014-05-07 10:46:42 -04:00
|
|
|
CheckSection(CFG, 'Boxcar')
|
|
|
|
CheckSection(CFG, 'Boxcar2')
|
2014-03-10 01:18:05 -04:00
|
|
|
CheckSection(CFG, 'NMJ')
|
|
|
|
CheckSection(CFG, 'NMJv2')
|
|
|
|
CheckSection(CFG, 'Synology')
|
|
|
|
CheckSection(CFG, 'SynologyNotifier')
|
|
|
|
CheckSection(CFG, 'pyTivo')
|
|
|
|
CheckSection(CFG, 'NMA')
|
|
|
|
CheckSection(CFG, 'Pushalot')
|
|
|
|
CheckSection(CFG, 'Pushbullet')
|
|
|
|
CheckSection(CFG, 'Subtitles')
|
|
|
|
|
2014-08-17 20:15:02 -04:00
|
|
|
# wanted branch
|
2014-07-28 20:11:16 -04:00
|
|
|
BRANCH = check_setting_str(CFG, 'General', 'branch', '')
|
|
|
|
|
2014-08-15 02:54:22 -04:00
|
|
|
# current commit hash
|
|
|
|
CUR_COMMIT_HASH = check_setting_str(CFG, 'General', 'cur_commit_hash', '')
|
|
|
|
|
2014-08-17 20:15:02 -04:00
|
|
|
# current commit branch
|
|
|
|
CUR_COMMIT_BRANCH = check_setting_str(CFG, 'General', 'cur_commit_branch', '')
|
|
|
|
|
2014-07-14 22:00:53 -04:00
|
|
|
ACTUAL_CACHE_DIR = check_setting_str(CFG, 'General', 'cache_dir', 'cache')
|
2014-08-17 20:15:02 -04:00
|
|
|
|
2014-07-14 22:00:53 -04:00
|
|
|
# fix bad configs due to buggy code
|
|
|
|
if ACTUAL_CACHE_DIR == 'None':
|
|
|
|
ACTUAL_CACHE_DIR = 'cache'
|
|
|
|
|
|
|
|
# unless they specify, put the cache dir inside the data dir
|
|
|
|
if not os.path.isabs(ACTUAL_CACHE_DIR):
|
|
|
|
CACHE_DIR = os.path.join(DATA_DIR, ACTUAL_CACHE_DIR)
|
|
|
|
else:
|
|
|
|
CACHE_DIR = ACTUAL_CACHE_DIR
|
|
|
|
|
|
|
|
if not helpers.makeDir(CACHE_DIR):
|
|
|
|
logger.log(u"!!! Creating local cache dir failed, using system default", logger.ERROR)
|
|
|
|
CACHE_DIR = None
|
|
|
|
|
2014-07-27 07:58:14 -04:00
|
|
|
# clean cache folders
|
|
|
|
if CACHE_DIR:
|
|
|
|
helpers.clearCache()
|
|
|
|
|
2014-06-11 04:34:28 -04:00
|
|
|
GUI_NAME = check_setting_str(CFG, 'GUI', 'gui_name', 'slick')
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
ACTUAL_LOG_DIR = check_setting_str(CFG, 'General', 'log_dir', 'Logs')
|
|
|
|
# put the log dir inside the data dir, unless an absolute path
|
|
|
|
LOG_DIR = os.path.normpath(os.path.join(DATA_DIR, ACTUAL_LOG_DIR))
|
2014-03-25 01:57:24 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
if not helpers.makeDir(LOG_DIR):
|
|
|
|
logger.log(u"!!! No log folder, logging to screen only!", logger.ERROR)
|
2014-03-25 01:57:24 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
SOCKET_TIMEOUT = check_setting_int(CFG, 'General', 'socket_timeout', 30)
|
|
|
|
socket.setdefaulttimeout(SOCKET_TIMEOUT)
|
2014-03-25 01:57:24 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
try:
|
|
|
|
WEB_PORT = check_setting_int(CFG, 'General', 'web_port', 8081)
|
|
|
|
except:
|
|
|
|
WEB_PORT = 8081
|
|
|
|
|
|
|
|
if WEB_PORT < 21 or WEB_PORT > 65535:
|
|
|
|
WEB_PORT = 8081
|
|
|
|
|
|
|
|
WEB_HOST = check_setting_str(CFG, 'General', 'web_host', '0.0.0.0')
|
|
|
|
WEB_IPV6 = bool(check_setting_int(CFG, 'General', 'web_ipv6', 0))
|
|
|
|
WEB_ROOT = check_setting_str(CFG, 'General', 'web_root', '').rstrip("/")
|
|
|
|
WEB_LOG = bool(check_setting_int(CFG, 'General', 'web_log', 0))
|
|
|
|
ENCRYPTION_VERSION = check_setting_int(CFG, 'General', 'encryption_version', 0)
|
|
|
|
WEB_USERNAME = check_setting_str(CFG, 'General', 'web_username', '')
|
|
|
|
WEB_PASSWORD = check_setting_str(CFG, 'General', 'web_password', '')
|
|
|
|
LAUNCH_BROWSER = bool(check_setting_int(CFG, 'General', 'launch_browser', 1))
|
2014-03-25 01:57:24 -04:00
|
|
|
|
2014-07-11 07:05:33 -04:00
|
|
|
PLAY_VIDEOS = bool(check_setting_int(CFG, 'General', 'play_videos', 0))
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
LOCALHOST_IP = check_setting_str(CFG, 'General', 'localhost_ip', '')
|
2014-05-17 07:40:26 -04:00
|
|
|
|
|
|
|
CPU_PRESET = check_setting_str(CFG, 'General', 'cpu_preset', 'NORMAL')
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
ANON_REDIRECT = check_setting_str(CFG, 'General', 'anon_redirect', 'http://dereferer.org/?')
|
2014-04-24 13:08:24 -04:00
|
|
|
PROXY_SETTING = check_setting_str(CFG, 'General', 'proxy_setting', '')
|
2014-03-10 01:18:05 -04:00
|
|
|
# attempt to help prevent users from breaking links by using a bad url
|
|
|
|
if not ANON_REDIRECT.endswith('?'):
|
|
|
|
ANON_REDIRECT = ''
|
|
|
|
|
|
|
|
UPDATE_SHOWS_ON_START = bool(check_setting_int(CFG, 'General', 'update_shows_on_start', 0))
|
|
|
|
SORT_ARTICLE = bool(check_setting_int(CFG, 'General', 'sort_article', 0))
|
|
|
|
|
|
|
|
USE_API = bool(check_setting_int(CFG, 'General', 'use_api', 0))
|
|
|
|
API_KEY = check_setting_str(CFG, 'General', 'api_key', '')
|
|
|
|
|
2014-04-28 18:22:44 -04:00
|
|
|
DEBUG = bool(check_setting_int(CFG, 'General', 'debug', 0))
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
ENABLE_HTTPS = bool(check_setting_int(CFG, 'General', 'enable_https', 0))
|
|
|
|
|
|
|
|
HTTPS_CERT = check_setting_str(CFG, 'General', 'https_cert', 'server.crt')
|
|
|
|
HTTPS_KEY = check_setting_str(CFG, 'General', 'https_key', 'server.key')
|
|
|
|
|
2014-05-04 14:47:09 -04:00
|
|
|
HANDLE_REVERSE_PROXY = bool(check_setting_int(CFG, 'General', 'handle_reverse_proxy', 0))
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
ROOT_DIRS = check_setting_str(CFG, 'General', 'root_dirs', '')
|
|
|
|
if not re.match(r'\d+\|[^|]+(?:\|[^|]+)*', ROOT_DIRS):
|
|
|
|
ROOT_DIRS = ''
|
|
|
|
|
|
|
|
QUALITY_DEFAULT = check_setting_int(CFG, 'General', 'quality_default', SD)
|
|
|
|
STATUS_DEFAULT = check_setting_int(CFG, 'General', 'status_default', SKIPPED)
|
2014-07-27 06:59:21 -04:00
|
|
|
VERSION_NOTIFY = bool(check_setting_int(CFG, 'General', 'version_notify', 1))
|
|
|
|
AUTO_UPDATE = bool(check_setting_int(CFG, 'General', 'auto_update', 0))
|
|
|
|
NOTIFY_ON_UPDATE = bool(check_setting_int(CFG, 'General', 'notify_on_update', 1))
|
2014-03-10 01:18:05 -04:00
|
|
|
FLATTEN_FOLDERS_DEFAULT = bool(check_setting_int(CFG, 'General', 'flatten_folders_default', 0))
|
2014-05-01 20:57:51 -04:00
|
|
|
INDEXER_DEFAULT = check_setting_int(CFG, 'General', 'indexer_default', 0)
|
2014-07-11 23:45:31 -04:00
|
|
|
INDEXER_TIMEOUT = check_setting_int(CFG, 'General', 'indexer_timeout', 20)
|
2014-05-26 02:29:22 -04:00
|
|
|
ANIME_DEFAULT = bool(check_setting_int(CFG, 'General', 'anime_default', 0))
|
2014-06-01 23:43:37 -04:00
|
|
|
SCENE_DEFAULT = bool(check_setting_int(CFG, 'General', 'scene_default', 0))
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
PROVIDER_ORDER = check_setting_str(CFG, 'General', 'provider_order', '').split()
|
|
|
|
|
|
|
|
NAMING_PATTERN = check_setting_str(CFG, 'General', 'naming_pattern', 'Season %0S/%SN - S%0SE%0E - %EN')
|
2014-07-11 23:45:31 -04:00
|
|
|
NAMING_ABD_PATTERN = check_setting_str(CFG, 'General', 'naming_abd_pattern', '%SN - %A.D - %EN')
|
2014-07-27 06:59:21 -04:00
|
|
|
NAMING_CUSTOM_ABD = bool(check_setting_int(CFG, 'General', 'naming_custom_abd', 0))
|
2014-07-11 23:45:31 -04:00
|
|
|
NAMING_SPORTS_PATTERN = check_setting_str(CFG, 'General', 'naming_sports_pattern', '%SN - %A-D - %EN')
|
2014-06-07 04:17:12 -04:00
|
|
|
NAMING_ANIME = check_setting_int(CFG, 'General', 'naming_anime', 3)
|
2014-07-27 06:59:21 -04:00
|
|
|
NAMING_CUSTOM_SPORTS = bool(check_setting_int(CFG, 'General', 'naming_custom_sports', 0))
|
2014-08-17 05:30:03 -04:00
|
|
|
NAMING_MULTI_EP = check_setting_int(CFG, 'General', 'naming_multi_ep', 1)
|
2014-03-10 01:18:05 -04:00
|
|
|
NAMING_FORCE_FOLDERS = naming.check_force_season_folders()
|
|
|
|
NAMING_STRIP_YEAR = bool(check_setting_int(CFG, 'General', 'naming_strip_year', 0))
|
|
|
|
|
|
|
|
USE_NZBS = bool(check_setting_int(CFG, 'General', 'use_nzbs', 0))
|
|
|
|
USE_TORRENTS = bool(check_setting_int(CFG, 'General', 'use_torrents', 1))
|
|
|
|
|
|
|
|
NZB_METHOD = check_setting_str(CFG, 'General', 'nzb_method', 'blackhole')
|
|
|
|
if NZB_METHOD not in ('blackhole', 'sabnzbd', 'nzbget'):
|
|
|
|
NZB_METHOD = 'blackhole'
|
|
|
|
|
|
|
|
TORRENT_METHOD = check_setting_str(CFG, 'General', 'torrent_method', 'blackhole')
|
|
|
|
if TORRENT_METHOD not in ('blackhole', 'utorrent', 'transmission', 'deluge', 'download_station', 'rtorrent'):
|
|
|
|
TORRENT_METHOD = 'blackhole'
|
|
|
|
|
|
|
|
DOWNLOAD_PROPERS = bool(check_setting_int(CFG, 'General', 'download_propers', 1))
|
2014-05-14 18:23:59 -04:00
|
|
|
CHECK_PROPERS_INTERVAL = check_setting_str(CFG, 'General', 'check_propers_interval', '')
|
|
|
|
if CHECK_PROPERS_INTERVAL not in ('15m', '45m', '90m', '4h', 'daily'):
|
|
|
|
CHECK_PROPERS_INTERVAL = 'daily'
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
ALLOW_HIGH_PRIORITY = bool(check_setting_int(CFG, 'General', 'allow_high_priority', 1))
|
|
|
|
|
2014-05-17 12:18:50 -04:00
|
|
|
DAILYSEARCH_STARTUP = bool(check_setting_int(CFG, 'General', 'dailysearch_startup', 1))
|
2014-05-06 18:27:44 -04:00
|
|
|
BACKLOG_STARTUP = bool(check_setting_int(CFG, 'General', 'backlog_startup', 1))
|
2014-05-17 18:14:31 -04:00
|
|
|
SKIP_REMOVED_FILES = bool(check_setting_int(CFG, 'General', 'skip_removed_files', 0))
|
2014-05-06 18:27:44 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
USENET_RETENTION = check_setting_int(CFG, 'General', 'usenet_retention', 500)
|
|
|
|
|
2014-08-11 06:19:48 -04:00
|
|
|
AUTOPOSTPROCESSER_FREQUENCY = check_setting_int(CFG, 'General', 'autopostprocesser_frequency',
|
2014-05-21 16:26:24 -04:00
|
|
|
DEFAULT_AUTOPOSTPROCESSER_FREQUENCY)
|
|
|
|
if AUTOPOSTPROCESSER_FREQUENCY < MIN_AUTOPOSTPROCESSER_FREQUENCY:
|
|
|
|
AUTOPOSTPROCESSER_FREQUENCY = MIN_AUTOPOSTPROCESSER_FREQUENCY
|
|
|
|
|
2014-05-19 16:06:32 -04:00
|
|
|
DAILYSEARCH_FREQUENCY = check_setting_int(CFG, 'General', 'dailysearch_frequency',
|
|
|
|
DEFAULT_DAILYSEARCH_FREQUENCY)
|
2014-05-17 12:18:50 -04:00
|
|
|
if DAILYSEARCH_FREQUENCY < MIN_DAILYSEARCH_FREQUENCY:
|
|
|
|
DAILYSEARCH_FREQUENCY = MIN_DAILYSEARCH_FREQUENCY
|
2014-05-15 00:16:46 -04:00
|
|
|
|
2014-05-17 12:18:50 -04:00
|
|
|
BACKLOG_FREQUENCY = check_setting_int(CFG, 'General', 'backlog_frequency', DEFAULT_BACKLOG_FREQUENCY)
|
|
|
|
if BACKLOG_FREQUENCY < MIN_BACKLOG_FREQUENCY:
|
|
|
|
BACKLOG_FREQUENCY = MIN_BACKLOG_FREQUENCY
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-05-15 00:16:46 -04:00
|
|
|
UPDATE_FREQUENCY = check_setting_int(CFG, 'General', 'update_frequency', DEFAULT_UPDATE_FREQUENCY)
|
2014-04-27 08:22:48 -04:00
|
|
|
if UPDATE_FREQUENCY < MIN_UPDATE_FREQUENCY:
|
|
|
|
UPDATE_FREQUENCY = MIN_UPDATE_FREQUENCY
|
2014-04-27 08:13:46 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
NZB_DIR = check_setting_str(CFG, 'Blackhole', 'nzb_dir', '')
|
|
|
|
TORRENT_DIR = check_setting_str(CFG, 'Blackhole', 'torrent_dir', '')
|
|
|
|
|
|
|
|
TV_DOWNLOAD_DIR = check_setting_str(CFG, 'General', 'tv_download_dir', '')
|
2014-07-27 06:59:21 -04:00
|
|
|
PROCESS_AUTOMATICALLY = bool(check_setting_int(CFG, 'General', 'process_automatically', 0))
|
|
|
|
UNPACK = bool(check_setting_int(CFG, 'General', 'unpack', 0))
|
|
|
|
RENAME_EPISODES = bool(check_setting_int(CFG, 'General', 'rename_episodes', 1))
|
|
|
|
AIRDATE_EPISODES = bool(check_setting_int(CFG, 'General', 'airdate_episodes', 0))
|
|
|
|
KEEP_PROCESSED_DIR = bool(check_setting_int(CFG, 'General', 'keep_processed_dir', 1))
|
2014-03-10 01:18:05 -04:00
|
|
|
PROCESS_METHOD = check_setting_str(CFG, 'General', 'process_method', 'copy' if KEEP_PROCESSED_DIR else 'move')
|
2014-07-27 06:59:21 -04:00
|
|
|
MOVE_ASSOCIATED_FILES = bool(check_setting_int(CFG, 'General', 'move_associated_files', 0))
|
2014-09-07 06:57:48 -04:00
|
|
|
POSTPONE_IF_SYNC_FILES = bool(check_setting_int(CFG, 'General', 'postpone_if_sync_files', 1))
|
2014-07-27 06:59:21 -04:00
|
|
|
NFO_RENAME = bool(check_setting_int(CFG, 'General', 'nfo_rename', 1))
|
|
|
|
CREATE_MISSING_SHOW_DIRS = bool(check_setting_int(CFG, 'General', 'create_missing_show_dirs', 0))
|
|
|
|
ADD_SHOWS_WO_DIR = bool(check_setting_int(CFG, 'General', 'add_shows_wo_dir', 0))
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
NZBS = bool(check_setting_int(CFG, 'NZBs', 'nzbs', 0))
|
|
|
|
NZBS_UID = check_setting_str(CFG, 'NZBs', 'nzbs_uid', '')
|
|
|
|
NZBS_HASH = check_setting_str(CFG, 'NZBs', 'nzbs_hash', '')
|
|
|
|
|
|
|
|
NEWZBIN = bool(check_setting_int(CFG, 'Newzbin', 'newzbin', 0))
|
|
|
|
NEWZBIN_USERNAME = check_setting_str(CFG, 'Newzbin', 'newzbin_username', '')
|
|
|
|
NEWZBIN_PASSWORD = check_setting_str(CFG, 'Newzbin', 'newzbin_password', '')
|
|
|
|
|
|
|
|
SAB_USERNAME = check_setting_str(CFG, 'SABnzbd', 'sab_username', '')
|
|
|
|
SAB_PASSWORD = check_setting_str(CFG, 'SABnzbd', 'sab_password', '')
|
|
|
|
SAB_APIKEY = check_setting_str(CFG, 'SABnzbd', 'sab_apikey', '')
|
|
|
|
SAB_CATEGORY = check_setting_str(CFG, 'SABnzbd', 'sab_category', 'tv')
|
|
|
|
SAB_HOST = check_setting_str(CFG, 'SABnzbd', 'sab_host', '')
|
|
|
|
|
2014-03-25 01:57:24 -04:00
|
|
|
NZBGET_USERNAME = check_setting_str(CFG, 'NZBget', 'nzbget_username', 'nzbget')
|
2014-03-10 01:18:05 -04:00
|
|
|
NZBGET_PASSWORD = check_setting_str(CFG, 'NZBget', 'nzbget_password', 'tegbzn6789')
|
|
|
|
NZBGET_CATEGORY = check_setting_str(CFG, 'NZBget', 'nzbget_category', 'tv')
|
|
|
|
NZBGET_HOST = check_setting_str(CFG, 'NZBget', 'nzbget_host', '')
|
2014-05-05 18:48:28 -04:00
|
|
|
NZBGET_USE_HTTPS = bool(check_setting_int(CFG, 'NZBget', 'nzbget_use_https', 0))
|
2014-08-11 16:07:02 -04:00
|
|
|
NZBGET_PRIORITY = check_setting_int(CFG, 'NZBget', 'nzbget_priority', 100)
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
TORRENT_USERNAME = check_setting_str(CFG, 'TORRENT', 'torrent_username', '')
|
|
|
|
TORRENT_PASSWORD = check_setting_str(CFG, 'TORRENT', 'torrent_password', '')
|
|
|
|
TORRENT_HOST = check_setting_str(CFG, 'TORRENT', 'torrent_host', '')
|
|
|
|
TORRENT_PATH = check_setting_str(CFG, 'TORRENT', 'torrent_path', '')
|
2014-05-12 03:05:16 -04:00
|
|
|
TORRENT_SEED_TIME = check_setting_int(CFG, 'TORRENT', 'torrent_seed_time', 0)
|
2014-03-10 01:18:05 -04:00
|
|
|
TORRENT_PAUSED = bool(check_setting_int(CFG, 'TORRENT', 'torrent_paused', 0))
|
|
|
|
TORRENT_HIGH_BANDWIDTH = bool(check_setting_int(CFG, 'TORRENT', 'torrent_high_bandwidth', 0))
|
|
|
|
TORRENT_LABEL = check_setting_str(CFG, 'TORRENT', 'torrent_label', '')
|
2014-05-11 03:31:38 -04:00
|
|
|
TORRENT_VERIFY_CERT = bool(check_setting_int(CFG, 'TORRENT', 'torrent_verify_cert', 0))
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
USE_XBMC = bool(check_setting_int(CFG, 'XBMC', 'use_xbmc', 0))
|
2014-05-08 11:54:43 -04:00
|
|
|
XBMC_ALWAYS_ON = bool(check_setting_int(CFG, 'XBMC', 'xbmc_always_on', 1))
|
2014-03-10 01:18:05 -04:00
|
|
|
XBMC_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'XBMC', 'xbmc_notify_onsnatch', 0))
|
|
|
|
XBMC_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'XBMC', 'xbmc_notify_ondownload', 0))
|
|
|
|
XBMC_NOTIFY_ONSUBTITLEDOWNLOAD = bool(check_setting_int(CFG, 'XBMC', 'xbmc_notify_onsubtitledownload', 0))
|
|
|
|
XBMC_UPDATE_LIBRARY = bool(check_setting_int(CFG, 'XBMC', 'xbmc_update_library', 0))
|
|
|
|
XBMC_UPDATE_FULL = bool(check_setting_int(CFG, 'XBMC', 'xbmc_update_full', 0))
|
|
|
|
XBMC_UPDATE_ONLYFIRST = bool(check_setting_int(CFG, 'XBMC', 'xbmc_update_onlyfirst', 0))
|
|
|
|
XBMC_HOST = check_setting_str(CFG, 'XBMC', 'xbmc_host', '')
|
|
|
|
XBMC_USERNAME = check_setting_str(CFG, 'XBMC', 'xbmc_username', '')
|
|
|
|
XBMC_PASSWORD = check_setting_str(CFG, 'XBMC', 'xbmc_password', '')
|
|
|
|
|
|
|
|
USE_PLEX = bool(check_setting_int(CFG, 'Plex', 'use_plex', 0))
|
|
|
|
PLEX_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Plex', 'plex_notify_onsnatch', 0))
|
|
|
|
PLEX_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Plex', 'plex_notify_ondownload', 0))
|
|
|
|
PLEX_NOTIFY_ONSUBTITLEDOWNLOAD = bool(check_setting_int(CFG, 'Plex', 'plex_notify_onsubtitledownload', 0))
|
|
|
|
PLEX_UPDATE_LIBRARY = bool(check_setting_int(CFG, 'Plex', 'plex_update_library', 0))
|
|
|
|
PLEX_SERVER_HOST = check_setting_str(CFG, 'Plex', 'plex_server_host', '')
|
|
|
|
PLEX_HOST = check_setting_str(CFG, 'Plex', 'plex_host', '')
|
|
|
|
PLEX_USERNAME = check_setting_str(CFG, 'Plex', 'plex_username', '')
|
|
|
|
PLEX_PASSWORD = check_setting_str(CFG, 'Plex', 'plex_password', '')
|
|
|
|
|
|
|
|
USE_GROWL = bool(check_setting_int(CFG, 'Growl', 'use_growl', 0))
|
|
|
|
GROWL_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Growl', 'growl_notify_onsnatch', 0))
|
|
|
|
GROWL_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Growl', 'growl_notify_ondownload', 0))
|
|
|
|
GROWL_NOTIFY_ONSUBTITLEDOWNLOAD = bool(check_setting_int(CFG, 'Growl', 'growl_notify_onsubtitledownload', 0))
|
|
|
|
GROWL_HOST = check_setting_str(CFG, 'Growl', 'growl_host', '')
|
|
|
|
GROWL_PASSWORD = check_setting_str(CFG, 'Growl', 'growl_password', '')
|
|
|
|
|
|
|
|
USE_PROWL = bool(check_setting_int(CFG, 'Prowl', 'use_prowl', 0))
|
|
|
|
PROWL_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Prowl', 'prowl_notify_onsnatch', 0))
|
|
|
|
PROWL_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Prowl', 'prowl_notify_ondownload', 0))
|
|
|
|
PROWL_NOTIFY_ONSUBTITLEDOWNLOAD = bool(check_setting_int(CFG, 'Prowl', 'prowl_notify_onsubtitledownload', 0))
|
|
|
|
PROWL_API = check_setting_str(CFG, 'Prowl', 'prowl_api', '')
|
|
|
|
PROWL_PRIORITY = check_setting_str(CFG, 'Prowl', 'prowl_priority', "0")
|
|
|
|
|
|
|
|
USE_TWITTER = bool(check_setting_int(CFG, 'Twitter', 'use_twitter', 0))
|
|
|
|
TWITTER_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Twitter', 'twitter_notify_onsnatch', 0))
|
|
|
|
TWITTER_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Twitter', 'twitter_notify_ondownload', 0))
|
2014-03-25 01:57:24 -04:00
|
|
|
TWITTER_NOTIFY_ONSUBTITLEDOWNLOAD = bool(
|
|
|
|
check_setting_int(CFG, 'Twitter', 'twitter_notify_onsubtitledownload', 0))
|
2014-03-10 01:18:05 -04:00
|
|
|
TWITTER_USERNAME = check_setting_str(CFG, 'Twitter', 'twitter_username', '')
|
|
|
|
TWITTER_PASSWORD = check_setting_str(CFG, 'Twitter', 'twitter_password', '')
|
2014-05-23 08:37:22 -04:00
|
|
|
TWITTER_PREFIX = check_setting_str(CFG, 'Twitter', 'twitter_prefix', 'SickRage')
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
USE_BOXCAR = bool(check_setting_int(CFG, 'Boxcar', 'use_boxcar', 0))
|
|
|
|
BOXCAR_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Boxcar', 'boxcar_notify_onsnatch', 0))
|
|
|
|
BOXCAR_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Boxcar', 'boxcar_notify_ondownload', 0))
|
|
|
|
BOXCAR_NOTIFY_ONSUBTITLEDOWNLOAD = bool(check_setting_int(CFG, 'Boxcar', 'boxcar_notify_onsubtitledownload', 0))
|
|
|
|
BOXCAR_USERNAME = check_setting_str(CFG, 'Boxcar', 'boxcar_username', '')
|
|
|
|
|
2014-05-07 10:23:06 -04:00
|
|
|
USE_BOXCAR2 = bool(check_setting_int(CFG, 'Boxcar2', 'use_boxcar2', 0))
|
2014-05-07 10:31:23 -04:00
|
|
|
BOXCAR2_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Boxcar2', 'boxcar2_notify_onsnatch', 0))
|
|
|
|
BOXCAR2_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Boxcar2', 'boxcar2_notify_ondownload', 0))
|
2014-05-13 01:48:00 -04:00
|
|
|
BOXCAR2_NOTIFY_ONSUBTITLEDOWNLOAD = bool(
|
|
|
|
check_setting_int(CFG, 'Boxcar2', 'boxcar2_notify_onsubtitledownload', 0))
|
2014-05-07 10:23:06 -04:00
|
|
|
BOXCAR2_ACCESSTOKEN = check_setting_str(CFG, 'Boxcar2', 'boxcar2_accesstoken', '')
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
USE_PUSHOVER = bool(check_setting_int(CFG, 'Pushover', 'use_pushover', 0))
|
|
|
|
PUSHOVER_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Pushover', 'pushover_notify_onsnatch', 0))
|
|
|
|
PUSHOVER_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Pushover', 'pushover_notify_ondownload', 0))
|
2014-07-27 06:59:21 -04:00
|
|
|
PUSHOVER_NOTIFY_ONSUBTITLEDOWNLOAD = bool(
|
|
|
|
check_setting_int(CFG, 'Pushover', 'pushover_notify_onsubtitledownload', 0))
|
2014-03-10 01:18:05 -04:00
|
|
|
PUSHOVER_USERKEY = check_setting_str(CFG, 'Pushover', 'pushover_userkey', '')
|
2014-06-29 06:05:33 -04:00
|
|
|
PUSHOVER_APIKEY = check_setting_str(CFG, 'Pushover', 'pushover_apikey', '')
|
2014-03-10 01:18:05 -04:00
|
|
|
USE_LIBNOTIFY = bool(check_setting_int(CFG, 'Libnotify', 'use_libnotify', 0))
|
|
|
|
LIBNOTIFY_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Libnotify', 'libnotify_notify_onsnatch', 0))
|
|
|
|
LIBNOTIFY_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Libnotify', 'libnotify_notify_ondownload', 0))
|
2014-03-25 01:57:24 -04:00
|
|
|
LIBNOTIFY_NOTIFY_ONSUBTITLEDOWNLOAD = bool(
|
|
|
|
check_setting_int(CFG, 'Libnotify', 'libnotify_notify_onsubtitledownload', 0))
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
USE_NMJ = bool(check_setting_int(CFG, 'NMJ', 'use_nmj', 0))
|
|
|
|
NMJ_HOST = check_setting_str(CFG, 'NMJ', 'nmj_host', '')
|
|
|
|
NMJ_DATABASE = check_setting_str(CFG, 'NMJ', 'nmj_database', '')
|
|
|
|
NMJ_MOUNT = check_setting_str(CFG, 'NMJ', 'nmj_mount', '')
|
|
|
|
|
|
|
|
USE_NMJv2 = bool(check_setting_int(CFG, 'NMJv2', 'use_nmjv2', 0))
|
|
|
|
NMJv2_HOST = check_setting_str(CFG, 'NMJv2', 'nmjv2_host', '')
|
|
|
|
NMJv2_DATABASE = check_setting_str(CFG, 'NMJv2', 'nmjv2_database', '')
|
|
|
|
NMJv2_DBLOC = check_setting_str(CFG, 'NMJv2', 'nmjv2_dbloc', '')
|
|
|
|
|
|
|
|
USE_SYNOINDEX = bool(check_setting_int(CFG, 'Synology', 'use_synoindex', 0))
|
|
|
|
|
|
|
|
USE_SYNOLOGYNOTIFIER = bool(check_setting_int(CFG, 'SynologyNotifier', 'use_synologynotifier', 0))
|
2014-03-25 01:57:24 -04:00
|
|
|
SYNOLOGYNOTIFIER_NOTIFY_ONSNATCH = bool(
|
|
|
|
check_setting_int(CFG, 'SynologyNotifier', 'synologynotifier_notify_onsnatch', 0))
|
|
|
|
SYNOLOGYNOTIFIER_NOTIFY_ONDOWNLOAD = bool(
|
|
|
|
check_setting_int(CFG, 'SynologyNotifier', 'synologynotifier_notify_ondownload', 0))
|
|
|
|
SYNOLOGYNOTIFIER_NOTIFY_ONSUBTITLEDOWNLOAD = bool(
|
|
|
|
check_setting_int(CFG, 'SynologyNotifier', 'synologynotifier_notify_onsubtitledownload', 0))
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
USE_TRAKT = bool(check_setting_int(CFG, 'Trakt', 'use_trakt', 0))
|
|
|
|
TRAKT_USERNAME = check_setting_str(CFG, 'Trakt', 'trakt_username', '')
|
|
|
|
TRAKT_PASSWORD = check_setting_str(CFG, 'Trakt', 'trakt_password', '')
|
|
|
|
TRAKT_API = check_setting_str(CFG, 'Trakt', 'trakt_api', '')
|
|
|
|
TRAKT_REMOVE_WATCHLIST = bool(check_setting_int(CFG, 'Trakt', 'trakt_remove_watchlist', 0))
|
2014-08-11 07:29:35 -04:00
|
|
|
TRAKT_REMOVE_SERIESLIST = bool(check_setting_int(CFG, 'Trakt', 'trakt_remove_serieslist', 0))
|
2014-03-10 01:18:05 -04:00
|
|
|
TRAKT_USE_WATCHLIST = bool(check_setting_int(CFG, 'Trakt', 'trakt_use_watchlist', 0))
|
2014-07-27 06:59:21 -04:00
|
|
|
TRAKT_METHOD_ADD = check_setting_int(CFG, 'Trakt', 'trakt_method_add', 0)
|
2014-03-10 01:18:05 -04:00
|
|
|
TRAKT_START_PAUSED = bool(check_setting_int(CFG, 'Trakt', 'trakt_start_paused', 0))
|
2014-06-28 23:28:00 -04:00
|
|
|
TRAKT_USE_RECOMMENDED = bool(check_setting_int(CFG, 'Trakt', 'trakt_use_recommended', 0))
|
2014-06-29 01:54:29 -04:00
|
|
|
TRAKT_SYNC = bool(check_setting_int(CFG, 'Trakt', 'trakt_sync', 0))
|
2014-07-24 00:44:11 -04:00
|
|
|
TRAKT_DEFAULT_INDEXER = check_setting_int(CFG, 'Trakt', 'trakt_default_indexer', 1)
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
CheckSection(CFG, 'pyTivo')
|
|
|
|
USE_PYTIVO = bool(check_setting_int(CFG, 'pyTivo', 'use_pytivo', 0))
|
|
|
|
PYTIVO_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'pyTivo', 'pytivo_notify_onsnatch', 0))
|
|
|
|
PYTIVO_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'pyTivo', 'pytivo_notify_ondownload', 0))
|
|
|
|
PYTIVO_NOTIFY_ONSUBTITLEDOWNLOAD = bool(check_setting_int(CFG, 'pyTivo', 'pytivo_notify_onsubtitledownload', 0))
|
|
|
|
PYTIVO_UPDATE_LIBRARY = bool(check_setting_int(CFG, 'pyTivo', 'pyTivo_update_library', 0))
|
|
|
|
PYTIVO_HOST = check_setting_str(CFG, 'pyTivo', 'pytivo_host', '')
|
|
|
|
PYTIVO_SHARE_NAME = check_setting_str(CFG, 'pyTivo', 'pytivo_share_name', '')
|
|
|
|
PYTIVO_TIVO_NAME = check_setting_str(CFG, 'pyTivo', 'pytivo_tivo_name', '')
|
|
|
|
|
|
|
|
USE_NMA = bool(check_setting_int(CFG, 'NMA', 'use_nma', 0))
|
|
|
|
NMA_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'NMA', 'nma_notify_onsnatch', 0))
|
|
|
|
NMA_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'NMA', 'nma_notify_ondownload', 0))
|
|
|
|
NMA_NOTIFY_ONSUBTITLEDOWNLOAD = bool(check_setting_int(CFG, 'NMA', 'nma_notify_onsubtitledownload', 0))
|
|
|
|
NMA_API = check_setting_str(CFG, 'NMA', 'nma_api', '')
|
|
|
|
NMA_PRIORITY = check_setting_str(CFG, 'NMA', 'nma_priority', "0")
|
|
|
|
|
|
|
|
USE_PUSHALOT = bool(check_setting_int(CFG, 'Pushalot', 'use_pushalot', 0))
|
|
|
|
PUSHALOT_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Pushalot', 'pushalot_notify_onsnatch', 0))
|
|
|
|
PUSHALOT_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Pushalot', 'pushalot_notify_ondownload', 0))
|
2014-03-25 01:57:24 -04:00
|
|
|
PUSHALOT_NOTIFY_ONSUBTITLEDOWNLOAD = bool(
|
|
|
|
check_setting_int(CFG, 'Pushalot', 'pushalot_notify_onsubtitledownload', 0))
|
2014-03-10 01:18:05 -04:00
|
|
|
PUSHALOT_AUTHORIZATIONTOKEN = check_setting_str(CFG, 'Pushalot', 'pushalot_authorizationtoken', '')
|
|
|
|
|
|
|
|
USE_PUSHBULLET = bool(check_setting_int(CFG, 'Pushbullet', 'use_pushbullet', 0))
|
|
|
|
PUSHBULLET_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Pushbullet', 'pushbullet_notify_onsnatch', 0))
|
|
|
|
PUSHBULLET_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Pushbullet', 'pushbullet_notify_ondownload', 0))
|
2014-03-25 01:57:24 -04:00
|
|
|
PUSHBULLET_NOTIFY_ONSUBTITLEDOWNLOAD = bool(
|
|
|
|
check_setting_int(CFG, 'Pushbullet', 'pushbullet_notify_onsubtitledownload', 0))
|
2014-03-10 01:18:05 -04:00
|
|
|
PUSHBULLET_API = check_setting_str(CFG, 'Pushbullet', 'pushbullet_api', '')
|
|
|
|
PUSHBULLET_DEVICE = check_setting_str(CFG, 'Pushbullet', 'pushbullet_device', '')
|
|
|
|
|
|
|
|
USE_EMAIL = bool(check_setting_int(CFG, 'Email', 'use_email', 0))
|
|
|
|
EMAIL_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Email', 'email_notify_onsnatch', 0))
|
|
|
|
EMAIL_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Email', 'email_notify_ondownload', 0))
|
|
|
|
EMAIL_NOTIFY_ONSUBTITLEDOWNLOAD = bool(check_setting_int(CFG, 'Email', 'email_notify_onsubtitledownload', 0))
|
|
|
|
EMAIL_HOST = check_setting_str(CFG, 'Email', 'email_host', '')
|
|
|
|
EMAIL_PORT = check_setting_int(CFG, 'Email', 'email_port', 25)
|
|
|
|
EMAIL_TLS = bool(check_setting_int(CFG, 'Email', 'email_tls', 0))
|
|
|
|
EMAIL_USER = check_setting_str(CFG, 'Email', 'email_user', '')
|
|
|
|
EMAIL_PASSWORD = check_setting_str(CFG, 'Email', 'email_password', '')
|
|
|
|
EMAIL_FROM = check_setting_str(CFG, 'Email', 'email_from', '')
|
|
|
|
EMAIL_LIST = check_setting_str(CFG, 'Email', 'email_list', '')
|
|
|
|
|
|
|
|
USE_SUBTITLES = bool(check_setting_int(CFG, 'Subtitles', 'use_subtitles', 0))
|
|
|
|
SUBTITLES_LANGUAGES = check_setting_str(CFG, 'Subtitles', 'subtitles_languages', '').split(',')
|
|
|
|
if SUBTITLES_LANGUAGES[0] == '':
|
|
|
|
SUBTITLES_LANGUAGES = []
|
|
|
|
SUBTITLES_DIR = check_setting_str(CFG, 'Subtitles', 'subtitles_dir', '')
|
|
|
|
SUBTITLES_SERVICES_LIST = check_setting_str(CFG, 'Subtitles', 'SUBTITLES_SERVICES_LIST', '').split(',')
|
2014-03-25 01:57:24 -04:00
|
|
|
SUBTITLES_SERVICES_ENABLED = [int(x) for x in
|
|
|
|
check_setting_str(CFG, 'Subtitles', 'SUBTITLES_SERVICES_ENABLED', '').split('|')
|
|
|
|
if x]
|
2014-03-10 01:18:05 -04:00
|
|
|
SUBTITLES_DEFAULT = bool(check_setting_int(CFG, 'Subtitles', 'subtitles_default', 0))
|
|
|
|
SUBTITLES_HISTORY = bool(check_setting_int(CFG, 'Subtitles', 'subtitles_history', 0))
|
|
|
|
SUBTITLES_FINDER_FREQUENCY = check_setting_int(CFG, 'Subtitles', 'subtitles_finder_frequency', 1)
|
|
|
|
|
|
|
|
USE_FAILED_DOWNLOADS = bool(check_setting_int(CFG, 'FailedDownloads', 'use_failed_downloads', 0))
|
|
|
|
DELETE_FAILED = bool(check_setting_int(CFG, 'FailedDownloads', 'delete_failed', 0))
|
|
|
|
|
|
|
|
GIT_PATH = check_setting_str(CFG, 'General', 'git_path', '')
|
|
|
|
|
|
|
|
IGNORE_WORDS = check_setting_str(CFG, 'General', 'ignore_words', IGNORE_WORDS)
|
2014-03-25 01:57:24 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
CALENDAR_UNPROTECTED = bool(check_setting_int(CFG, 'General', 'calendar_unprotected', 0))
|
|
|
|
|
2014-03-25 01:57:24 -04:00
|
|
|
EXTRA_SCRIPTS = [x.strip() for x in check_setting_str(CFG, 'General', 'extra_scripts', '').split('|') if
|
|
|
|
x.strip()]
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
USE_LISTVIEW = bool(check_setting_int(CFG, 'General', 'use_listview', 0))
|
|
|
|
|
2014-05-26 02:29:22 -04:00
|
|
|
ANIMESUPPORT = False
|
2014-07-27 06:59:21 -04:00
|
|
|
USE_ANIDB = bool(check_setting_int(CFG, 'ANIDB', 'use_anidb', 0))
|
2014-05-26 02:29:22 -04:00
|
|
|
ANIDB_USERNAME = check_setting_str(CFG, 'ANIDB', 'anidb_username', '')
|
|
|
|
ANIDB_PASSWORD = check_setting_str(CFG, 'ANIDB', 'anidb_password', '')
|
2014-07-07 07:23:59 -04:00
|
|
|
ANIDB_USE_MYLIST = bool(check_setting_int(CFG, 'ANIDB', 'anidb_use_mylist', 0))
|
2014-07-27 06:59:21 -04:00
|
|
|
|
2014-05-26 02:29:22 -04:00
|
|
|
ANIME_SPLIT_HOME = bool(check_setting_int(CFG, 'ANIME', 'anime_split_home', 0))
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
METADATA_XBMC = check_setting_str(CFG, 'General', 'metadata_xbmc', '0|0|0|0|0|0|0|0|0|0')
|
|
|
|
METADATA_XBMC_12PLUS = check_setting_str(CFG, 'General', 'metadata_xbmc_12plus', '0|0|0|0|0|0|0|0|0|0')
|
|
|
|
METADATA_MEDIABROWSER = check_setting_str(CFG, 'General', 'metadata_mediabrowser', '0|0|0|0|0|0|0|0|0|0')
|
|
|
|
METADATA_PS3 = check_setting_str(CFG, 'General', 'metadata_ps3', '0|0|0|0|0|0|0|0|0|0')
|
|
|
|
METADATA_WDTV = check_setting_str(CFG, 'General', 'metadata_wdtv', '0|0|0|0|0|0|0|0|0|0')
|
|
|
|
METADATA_TIVO = check_setting_str(CFG, 'General', 'metadata_tivo', '0|0|0|0|0|0|0|0|0|0')
|
2014-05-11 19:15:24 -04:00
|
|
|
METADATA_MEDE8ER = check_setting_str(CFG, 'General', 'metadata_mede8er', '0|0|0|0|0|0|0|0|0|0')
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
HOME_LAYOUT = check_setting_str(CFG, 'GUI', 'home_layout', 'poster')
|
|
|
|
HISTORY_LAYOUT = check_setting_str(CFG, 'GUI', 'history_layout', 'detailed')
|
|
|
|
DISPLAY_SHOW_SPECIALS = bool(check_setting_int(CFG, 'GUI', 'display_show_specials', 1))
|
|
|
|
COMING_EPS_LAYOUT = check_setting_str(CFG, 'GUI', 'coming_eps_layout', 'banner')
|
|
|
|
COMING_EPS_DISPLAY_PAUSED = bool(check_setting_int(CFG, 'GUI', 'coming_eps_display_paused', 0))
|
|
|
|
COMING_EPS_SORT = check_setting_str(CFG, 'GUI', 'coming_eps_sort', 'date')
|
|
|
|
COMING_EPS_MISSED_RANGE = check_setting_int(CFG, 'GUI', 'coming_eps_missed_range', 7)
|
2014-05-23 11:20:44 -04:00
|
|
|
FUZZY_DATING = bool(check_setting_int(CFG, 'GUI', 'fuzzy_dating', 0))
|
|
|
|
TRIM_ZERO = bool(check_setting_int(CFG, 'GUI', 'trim_zero', 0))
|
2014-03-10 01:18:05 -04:00
|
|
|
DATE_PRESET = check_setting_str(CFG, 'GUI', 'date_preset', '%x')
|
|
|
|
TIME_PRESET_W_SECONDS = check_setting_str(CFG, 'GUI', 'time_preset', '%I:%M:%S %p')
|
2014-03-25 01:57:24 -04:00
|
|
|
TIME_PRESET = TIME_PRESET_W_SECONDS.replace(u":%S", u"")
|
2014-05-17 03:30:21 -04:00
|
|
|
TIMEZONE_DISPLAY = check_setting_str(CFG, 'GUI', 'timezone_display', 'network')
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-07-27 06:59:21 -04:00
|
|
|
# initialize NZB and TORRENT providers
|
|
|
|
providerList = providers.makeProviderList()
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
NEWZNAB_DATA = check_setting_str(CFG, 'Newznab', 'newznab_data', '')
|
2014-03-25 01:57:24 -04:00
|
|
|
newznabProviderList = providers.getNewznabProviderList(NEWZNAB_DATA)
|
|
|
|
|
2014-05-23 12:35:01 -04:00
|
|
|
TORRENTRSS_DATA = check_setting_str(CFG, 'TorrentRss', 'torrentrss_data', '')
|
|
|
|
torrentRssProviderList = providers.getTorrentRssProviderList(TORRENTRSS_DATA)
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-07-27 06:59:21 -04:00
|
|
|
# dynamically load provider settings
|
|
|
|
for curTorrentProvider in [curProvider for curProvider in providers.sortedProviderList() if
|
|
|
|
curProvider.providerType == GenericProvider.TORRENT]:
|
|
|
|
curTorrentProvider.enabled = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID(), 0))
|
|
|
|
if hasattr(curTorrentProvider, 'api_key'):
|
|
|
|
curTorrentProvider.api_key = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_api_key', '')
|
|
|
|
if hasattr(curTorrentProvider, 'hash'):
|
|
|
|
curTorrentProvider.hash = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_hash', '')
|
|
|
|
if hasattr(curTorrentProvider, 'digest'):
|
|
|
|
curTorrentProvider.digest = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_digest', '')
|
|
|
|
if hasattr(curTorrentProvider, 'username'):
|
|
|
|
curTorrentProvider.username = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_username', '')
|
|
|
|
if hasattr(curTorrentProvider, 'password'):
|
|
|
|
curTorrentProvider.password = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_password', '')
|
|
|
|
if hasattr(curTorrentProvider, 'passkey'):
|
|
|
|
curTorrentProvider.passkey = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_passkey', '')
|
|
|
|
if hasattr(curTorrentProvider, 'proxy'):
|
|
|
|
curTorrentProvider.proxy.enabled = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_proxy', 0))
|
|
|
|
if hasattr(curTorrentProvider.proxy, 'url'):
|
|
|
|
curTorrentProvider.proxy.url = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_proxy_url', '')
|
|
|
|
if hasattr(curTorrentProvider, 'confirmed'):
|
|
|
|
curTorrentProvider.confirmed = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_confirmed', 0))
|
|
|
|
if hasattr(curTorrentProvider, 'options'):
|
|
|
|
curTorrentProvider.options = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_options', '')
|
|
|
|
if hasattr(curTorrentProvider, 'ratio'):
|
|
|
|
curTorrentProvider.ratio = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_ratio', '')
|
|
|
|
if hasattr(curTorrentProvider, 'minseed'):
|
|
|
|
curTorrentProvider.minseed = check_setting_int(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_minseed', 0)
|
|
|
|
if hasattr(curTorrentProvider, 'minleech'):
|
|
|
|
curTorrentProvider.minleech = check_setting_int(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_minleech', 0)
|
|
|
|
if hasattr(curTorrentProvider, 'freeleech'):
|
|
|
|
curTorrentProvider.freeleech = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_freeleech', 0))
|
|
|
|
if hasattr(curTorrentProvider, 'search_mode'):
|
|
|
|
curTorrentProvider.search_mode = check_setting_str(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_search_mode',
|
|
|
|
'eponly')
|
|
|
|
if hasattr(curTorrentProvider, 'search_fallback'):
|
|
|
|
curTorrentProvider.search_fallback = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_search_fallback',
|
|
|
|
0))
|
2014-08-29 01:16:25 -04:00
|
|
|
|
|
|
|
if hasattr(curTorrentProvider, 'enable_daily'):
|
|
|
|
curTorrentProvider.enable_daily = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_enable_daily',
|
|
|
|
1))
|
|
|
|
|
|
|
|
if hasattr(curTorrentProvider, 'enable_backlog'):
|
|
|
|
curTorrentProvider.enable_backlog = bool(check_setting_int(CFG, curTorrentProvider.getID().upper(),
|
|
|
|
curTorrentProvider.getID() + '_enable_backlog',
|
|
|
|
1))
|
2014-07-27 06:59:21 -04:00
|
|
|
|
|
|
|
for curNzbProvider in [curProvider for curProvider in providers.sortedProviderList() if
|
|
|
|
curProvider.providerType == GenericProvider.NZB]:
|
|
|
|
curNzbProvider.enabled = bool(
|
|
|
|
check_setting_int(CFG, curNzbProvider.getID().upper(), curNzbProvider.getID(), 0))
|
|
|
|
if hasattr(curNzbProvider, 'api_key'):
|
|
|
|
curNzbProvider.api_key = check_setting_str(CFG, curNzbProvider.getID().upper(),
|
|
|
|
curNzbProvider.getID() + '_api_key', '')
|
|
|
|
if hasattr(curNzbProvider, 'username'):
|
|
|
|
curNzbProvider.username = check_setting_str(CFG, curNzbProvider.getID().upper(),
|
|
|
|
curNzbProvider.getID() + '_username', '')
|
|
|
|
if hasattr(curNzbProvider, 'search_mode'):
|
|
|
|
curNzbProvider.search_mode = check_setting_str(CFG, curNzbProvider.getID().upper(),
|
|
|
|
curNzbProvider.getID() + '_search_mode',
|
|
|
|
'eponly')
|
|
|
|
if hasattr(curNzbProvider, 'search_fallback'):
|
|
|
|
curNzbProvider.search_fallback = bool(check_setting_int(CFG, curNzbProvider.getID().upper(),
|
|
|
|
curNzbProvider.getID() + '_search_fallback',
|
|
|
|
0))
|
2014-08-29 01:16:25 -04:00
|
|
|
if hasattr(curNzbProvider, 'enable_daily'):
|
|
|
|
curNzbProvider.enable_daily = bool(check_setting_int(CFG, curNzbProvider.getID().upper(),
|
|
|
|
curNzbProvider.getID() + '_enable_daily',
|
|
|
|
1))
|
|
|
|
|
|
|
|
if hasattr(curNzbProvider, 'enable_backlog'):
|
|
|
|
curNzbProvider.enable_backlog = bool(check_setting_int(CFG, curNzbProvider.getID().upper(),
|
2014-08-29 06:29:56 -04:00
|
|
|
curNzbProvider.getID() + '_enable_backlog',
|
|
|
|
1))
|
2014-07-27 06:59:21 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
if not os.path.isfile(CONFIG_FILE):
|
|
|
|
logger.log(u"Unable to find '" + CONFIG_FILE + "', all settings will be default!", logger.DEBUG)
|
|
|
|
save_config()
|
2014-03-25 01:57:24 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
# start up all the threads
|
|
|
|
logger.sb_log_instance.initLogging(consoleLogging=consoleLogging)
|
|
|
|
|
|
|
|
# initialize the main SB database
|
2014-06-21 18:46:59 -04:00
|
|
|
myDB = db.DBConnection()
|
|
|
|
db.upgradeDatabase(myDB, mainDB.InitialSchema)
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
# initialize the cache database
|
2014-06-21 18:46:59 -04:00
|
|
|
myDB = db.DBConnection('cache.db')
|
|
|
|
db.upgradeDatabase(myDB, cache_db.InitialSchema)
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-05-26 16:16:07 -04:00
|
|
|
# initialize the failed downloads database
|
2014-06-21 18:46:59 -04:00
|
|
|
myDB = db.DBConnection('failed.db')
|
|
|
|
db.upgradeDatabase(myDB, failed_db.InitialSchema)
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
# fix up any db problems
|
2014-06-21 18:46:59 -04:00
|
|
|
myDB = db.DBConnection()
|
|
|
|
db.sanityCheckDatabase(myDB, mainDB.MainSanityCheck)
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
# migrate the config if it needs it
|
|
|
|
migrator = ConfigMigrator(CFG)
|
|
|
|
migrator.migrate_config()
|
|
|
|
|
|
|
|
# initialize metadata_providers
|
|
|
|
metadata_provider_dict = metadata.get_metadata_generator_dict()
|
|
|
|
for cur_metadata_tuple in [(METADATA_XBMC, metadata.xbmc),
|
|
|
|
(METADATA_XBMC_12PLUS, metadata.xbmc_12plus),
|
|
|
|
(METADATA_MEDIABROWSER, metadata.mediabrowser),
|
|
|
|
(METADATA_PS3, metadata.ps3),
|
|
|
|
(METADATA_WDTV, metadata.wdtv),
|
|
|
|
(METADATA_TIVO, metadata.tivo),
|
2014-05-11 19:15:24 -04:00
|
|
|
(METADATA_MEDE8ER, metadata.mede8er),
|
2014-03-25 01:57:24 -04:00
|
|
|
]:
|
2014-03-10 01:18:05 -04:00
|
|
|
(cur_metadata_config, cur_metadata_class) = cur_metadata_tuple
|
|
|
|
tmp_provider = cur_metadata_class.metadata_class()
|
|
|
|
tmp_provider.set_config(cur_metadata_config)
|
|
|
|
metadata_provider_dict[tmp_provider.name] = tmp_provider
|
|
|
|
|
2014-06-19 03:12:30 -04:00
|
|
|
# initialize schedulers
|
|
|
|
# updaters
|
|
|
|
update_now = datetime.timedelta(minutes=0)
|
2014-06-11 04:34:28 -04:00
|
|
|
versionCheckScheduler = scheduler.Scheduler(versionChecker.CheckVersion(),
|
|
|
|
cycleTime=datetime.timedelta(hours=UPDATE_FREQUENCY),
|
|
|
|
threadName="CHECKVERSION",
|
2014-06-19 03:12:30 -04:00
|
|
|
silent=False)
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
showQueueScheduler = scheduler.Scheduler(show_queue.ShowQueue(),
|
2014-03-25 01:57:24 -04:00
|
|
|
cycleTime=datetime.timedelta(seconds=3),
|
2014-06-19 03:12:30 -04:00
|
|
|
threadName="SHOWQUEUE")
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-06-19 03:12:30 -04:00
|
|
|
showUpdateScheduler = scheduler.Scheduler(showUpdater.ShowUpdater(),
|
|
|
|
cycleTime=datetime.timedelta(hours=1),
|
|
|
|
threadName="SHOWUPDATER",
|
|
|
|
start_time=datetime.time(hour=3)) # 3 AM
|
|
|
|
|
|
|
|
# searchers
|
2014-03-10 01:18:05 -04:00
|
|
|
searchQueueScheduler = scheduler.Scheduler(search_queue.SearchQueue(),
|
2014-03-25 01:57:24 -04:00
|
|
|
cycleTime=datetime.timedelta(seconds=3),
|
2014-06-19 03:12:30 -04:00
|
|
|
threadName="SEARCHQUEUE")
|
|
|
|
|
|
|
|
update_interval = datetime.timedelta(minutes=DAILYSEARCH_FREQUENCY)
|
|
|
|
dailySearchScheduler = scheduler.Scheduler(dailysearcher.DailySearcher(),
|
|
|
|
cycleTime=update_interval,
|
|
|
|
threadName="DAILYSEARCHER",
|
|
|
|
run_delay=update_now if DAILYSEARCH_STARTUP
|
|
|
|
else update_interval)
|
|
|
|
|
|
|
|
update_interval = datetime.timedelta(minutes=BACKLOG_FREQUENCY)
|
|
|
|
backlogSearchScheduler = searchBacklog.BacklogSearchScheduler(searchBacklog.BacklogSearcher(),
|
|
|
|
cycleTime=update_interval,
|
|
|
|
threadName="BACKLOG",
|
|
|
|
run_delay=update_now if BACKLOG_STARTUP
|
|
|
|
else update_interval)
|
|
|
|
|
2014-07-27 06:59:21 -04:00
|
|
|
search_intervals = {'15m': 15, '45m': 45, '90m': 90, '4h': 4 * 60, 'daily': 24 * 60}
|
2014-06-19 03:12:30 -04:00
|
|
|
if CHECK_PROPERS_INTERVAL in search_intervals:
|
|
|
|
update_interval = datetime.timedelta(minutes=search_intervals[CHECK_PROPERS_INTERVAL])
|
|
|
|
run_at = None
|
|
|
|
else:
|
|
|
|
update_interval = datetime.timedelta(hours=1)
|
|
|
|
run_at = datetime.time(hour=1) # 1 AM
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-05-26 16:16:07 -04:00
|
|
|
properFinderScheduler = scheduler.Scheduler(properFinder.ProperFinder(),
|
2014-06-19 03:12:30 -04:00
|
|
|
cycleTime=update_interval,
|
2014-03-25 01:57:24 -04:00
|
|
|
threadName="FINDPROPERS",
|
2014-06-19 03:12:30 -04:00
|
|
|
start_time=run_at,
|
|
|
|
run_delay=update_interval)
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-06-19 03:12:30 -04:00
|
|
|
# processors
|
2014-06-11 04:34:28 -04:00
|
|
|
autoPostProcesserScheduler = scheduler.Scheduler(autoPostProcesser.PostProcesser(),
|
2014-05-23 02:42:11 -04:00
|
|
|
cycleTime=datetime.timedelta(
|
|
|
|
minutes=AUTOPOSTPROCESSER_FREQUENCY),
|
2014-03-25 01:57:24 -04:00
|
|
|
threadName="POSTPROCESSER",
|
2014-06-19 03:12:30 -04:00
|
|
|
silent=not PROCESS_AUTOMATICALLY)
|
2014-03-25 01:57:24 -04:00
|
|
|
|
2014-06-28 23:28:00 -04:00
|
|
|
traktCheckerScheduler = scheduler.Scheduler(traktChecker.TraktChecker(),
|
2014-07-27 06:59:21 -04:00
|
|
|
cycleTime=datetime.timedelta(hours=1),
|
|
|
|
threadName="TRAKTCHECKER",
|
|
|
|
silent=not USE_TRAKT)
|
2014-03-25 01:57:24 -04:00
|
|
|
|
2014-05-26 16:16:07 -04:00
|
|
|
subtitlesFinderScheduler = scheduler.Scheduler(subtitles.SubtitlesFinder(),
|
|
|
|
cycleTime=datetime.timedelta(hours=SUBTITLES_FINDER_FREQUENCY),
|
|
|
|
threadName="FINDSUBTITLES",
|
2014-06-19 03:12:30 -04:00
|
|
|
silent=not USE_SUBTITLES)
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-05-26 16:16:07 -04:00
|
|
|
showList = []
|
|
|
|
loadingShowList = {}
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
__INITIALIZED__ = True
|
|
|
|
return True
|
|
|
|
|
2014-08-29 01:16:25 -04:00
|
|
|
|
2014-03-25 01:57:24 -04:00
|
|
|
def start():
|
2014-07-07 17:30:27 -04:00
|
|
|
global __INITIALIZED__, backlogSearchScheduler, \
|
2014-04-23 03:47:42 -04:00
|
|
|
showUpdateScheduler, versionCheckScheduler, showQueueScheduler, \
|
2014-06-11 04:34:28 -04:00
|
|
|
properFinderScheduler, autoPostProcesserScheduler, searchQueueScheduler, \
|
2014-07-27 06:59:21 -04:00
|
|
|
subtitlesFinderScheduler, USE_SUBTITLES, traktCheckerScheduler, \
|
2014-07-11 19:37:09 -04:00
|
|
|
dailySearchScheduler, events, started
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
with INIT_LOCK:
|
|
|
|
if __INITIALIZED__:
|
2014-07-11 19:37:09 -04:00
|
|
|
# start sysetm events queue
|
|
|
|
events.start()
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-05-15 00:16:46 -04:00
|
|
|
# start the daily search scheduler
|
2014-07-14 22:00:53 -04:00
|
|
|
dailySearchScheduler.start()
|
2014-05-15 00:16:46 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
# start the backlog scheduler
|
2014-07-14 22:00:53 -04:00
|
|
|
backlogSearchScheduler.start()
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-05-26 16:16:07 -04:00
|
|
|
# start the show updater
|
2014-07-14 22:00:53 -04:00
|
|
|
showUpdateScheduler.start()
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-05-26 16:16:07 -04:00
|
|
|
# start the version checker
|
2014-07-14 22:00:53 -04:00
|
|
|
versionCheckScheduler.start()
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-05-12 04:52:14 -04:00
|
|
|
# start the queue checker
|
2014-07-14 22:00:53 -04:00
|
|
|
showQueueScheduler.start()
|
2014-05-12 04:52:14 -04:00
|
|
|
|
2014-05-26 16:16:07 -04:00
|
|
|
# start the search queue checker
|
2014-07-14 22:00:53 -04:00
|
|
|
searchQueueScheduler.start()
|
2014-05-26 16:16:07 -04:00
|
|
|
|
|
|
|
# start the queue checker
|
2014-07-28 22:20:48 -04:00
|
|
|
if DOWNLOAD_PROPERS:
|
|
|
|
properFinderScheduler.start()
|
2014-05-12 04:52:14 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
# start the proper finder
|
2014-07-28 22:20:48 -04:00
|
|
|
if PROCESS_AUTOMATICALLY:
|
|
|
|
autoPostProcesserScheduler.start()
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
# start the subtitles finder
|
2014-07-28 22:20:48 -04:00
|
|
|
if USE_SUBTITLES:
|
|
|
|
subtitlesFinderScheduler.start()
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-06-28 23:28:00 -04:00
|
|
|
# start the trakt checker
|
2014-07-28 22:20:48 -04:00
|
|
|
if USE_TRAKT:
|
|
|
|
traktCheckerScheduler.start()
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
started = True
|
|
|
|
|
|
|
|
|
2014-03-25 01:57:24 -04:00
|
|
|
def halt():
|
2014-07-07 17:30:27 -04:00
|
|
|
global __INITIALIZED__, backlogSearchScheduler, \
|
2014-05-26 16:16:07 -04:00
|
|
|
showUpdateScheduler, versionCheckScheduler, showQueueScheduler, \
|
2014-06-11 04:34:28 -04:00
|
|
|
properFinderScheduler, autoPostProcesserScheduler, searchQueueScheduler, \
|
2014-06-28 23:28:00 -04:00
|
|
|
subtitlesFinderScheduler, traktCheckerScheduler, \
|
2014-07-08 18:17:34 -04:00
|
|
|
dailySearchScheduler, events, started
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
with INIT_LOCK:
|
|
|
|
|
|
|
|
if __INITIALIZED__:
|
|
|
|
|
|
|
|
logger.log(u"Aborting all threads")
|
|
|
|
|
2014-07-28 20:58:49 -04:00
|
|
|
events.stop.set()
|
|
|
|
logger.log(u"Waiting for the EVENTS thread to exit")
|
|
|
|
try:
|
|
|
|
events.join(10)
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
2014-07-14 22:00:53 -04:00
|
|
|
dailySearchScheduler.stop.set()
|
2014-06-15 15:11:21 -04:00
|
|
|
logger.log(u"Waiting for the DAILYSEARCH thread to exit")
|
|
|
|
try:
|
2014-07-27 21:01:26 -04:00
|
|
|
dailySearchScheduler.join(10)
|
2014-06-15 15:11:21 -04:00
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
2014-07-14 22:00:53 -04:00
|
|
|
backlogSearchScheduler.stop.set()
|
2014-05-26 16:16:07 -04:00
|
|
|
logger.log(u"Waiting for the BACKLOG thread to exit")
|
|
|
|
try:
|
2014-07-27 21:01:26 -04:00
|
|
|
backlogSearchScheduler.join(10)
|
2014-05-26 16:16:07 -04:00
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
2014-07-14 22:00:53 -04:00
|
|
|
showUpdateScheduler.stop.set()
|
2014-03-10 01:18:05 -04:00
|
|
|
logger.log(u"Waiting for the SHOWUPDATER thread to exit")
|
|
|
|
try:
|
2014-07-27 21:01:26 -04:00
|
|
|
showUpdateScheduler.join(10)
|
2014-03-10 01:18:05 -04:00
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
2014-07-14 22:00:53 -04:00
|
|
|
versionCheckScheduler.stop.set()
|
2014-03-10 01:18:05 -04:00
|
|
|
logger.log(u"Waiting for the VERSIONCHECKER thread to exit")
|
|
|
|
try:
|
2014-07-27 21:01:26 -04:00
|
|
|
versionCheckScheduler.join(10)
|
2014-03-10 01:18:05 -04:00
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
2014-07-14 22:00:53 -04:00
|
|
|
showQueueScheduler.stop.set()
|
2014-03-10 01:18:05 -04:00
|
|
|
logger.log(u"Waiting for the SHOWQUEUE thread to exit")
|
|
|
|
try:
|
2014-07-27 21:01:26 -04:00
|
|
|
showQueueScheduler.join(10)
|
2014-03-10 01:18:05 -04:00
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
2014-07-14 22:00:53 -04:00
|
|
|
searchQueueScheduler.stop.set()
|
2014-03-10 01:18:05 -04:00
|
|
|
logger.log(u"Waiting for the SEARCHQUEUE thread to exit")
|
|
|
|
try:
|
2014-07-27 21:01:26 -04:00
|
|
|
searchQueueScheduler.join(10)
|
2014-03-10 01:18:05 -04:00
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
2014-07-28 22:20:48 -04:00
|
|
|
if PROCESS_AUTOMATICALLY:
|
|
|
|
autoPostProcesserScheduler.stop.set()
|
|
|
|
logger.log(u"Waiting for the POSTPROCESSER thread to exit")
|
|
|
|
try:
|
|
|
|
autoPostProcesserScheduler.join(10)
|
|
|
|
except:
|
|
|
|
pass
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-07-28 22:20:48 -04:00
|
|
|
if USE_TRAKT:
|
|
|
|
traktCheckerScheduler.stop.set()
|
|
|
|
logger.log(u"Waiting for the TRAKTCHECKER thread to exit")
|
|
|
|
try:
|
|
|
|
traktCheckerScheduler.join(10)
|
|
|
|
except:
|
|
|
|
pass
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-07-28 22:20:48 -04:00
|
|
|
if DOWNLOAD_PROPERS:
|
|
|
|
properFinderScheduler.stop.set()
|
|
|
|
logger.log(u"Waiting for the PROPERFINDER thread to exit")
|
|
|
|
try:
|
|
|
|
properFinderScheduler.join(10)
|
|
|
|
except:
|
|
|
|
pass
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-07-28 22:20:48 -04:00
|
|
|
if USE_SUBTITLES:
|
|
|
|
subtitlesFinderScheduler.stop.set()
|
|
|
|
logger.log(u"Waiting for the SUBTITLESFINDER thread to exit")
|
|
|
|
try:
|
|
|
|
subtitlesFinderScheduler.join(10)
|
|
|
|
except:
|
|
|
|
pass
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-05-26 02:29:22 -04:00
|
|
|
if ADBA_CONNECTION:
|
2014-07-18 02:21:11 -04:00
|
|
|
ADBA_CONNECTION.logout()
|
2014-05-26 02:29:22 -04:00
|
|
|
logger.log(u"Waiting for the ANIDB CONNECTION thread to exit")
|
|
|
|
try:
|
2014-07-18 02:21:11 -04:00
|
|
|
ADBA_CONNECTION.join(10)
|
2014-05-26 02:29:22 -04:00
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
__INITIALIZED__ = False
|
2014-07-02 14:51:14 -04:00
|
|
|
started = False
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-08-29 01:16:25 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
def sig_handler(signum=None, frame=None):
|
|
|
|
if type(signum) != type(None):
|
|
|
|
logger.log(u"Signal %i caught, saving and exiting..." % int(signum))
|
2014-07-08 18:17:34 -04:00
|
|
|
events.put(events.SystemEvent.SHUTDOWN)
|
2014-03-10 01:18:05 -04:00
|
|
|
|
2014-07-27 06:59:21 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
def saveAll():
|
|
|
|
global showList
|
|
|
|
|
|
|
|
# write all shows
|
|
|
|
logger.log(u"Saving all shows to the database")
|
|
|
|
for show in showList:
|
|
|
|
show.saveToDB()
|
|
|
|
|
|
|
|
# save config
|
|
|
|
logger.log(u"Saving config file to disk")
|
|
|
|
save_config()
|
|
|
|
|
2014-07-27 06:59:21 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
def restart(soft=True):
|
|
|
|
if soft:
|
|
|
|
halt()
|
|
|
|
saveAll()
|
|
|
|
logger.log(u"Re-initializing all data")
|
|
|
|
initialize()
|
|
|
|
else:
|
2014-07-08 18:17:34 -04:00
|
|
|
events.put(events.SystemEvent.RESTART)
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
|
|
|
|
def save_config():
|
|
|
|
new_config = ConfigObj()
|
|
|
|
new_config.filename = CONFIG_FILE
|
2014-03-25 01:57:24 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
# For passwords you must include the word `password` in the item_name and add `helpers.encrypt(ITEM_NAME, ENCRYPTION_VERSION)` in save_config()
|
|
|
|
new_config['General'] = {}
|
2014-07-28 20:11:16 -04:00
|
|
|
new_config['General']['branch'] = BRANCH
|
2014-08-15 02:54:22 -04:00
|
|
|
new_config['General']['cur_commit_hash'] = CUR_COMMIT_HASH
|
2014-08-17 20:15:02 -04:00
|
|
|
new_config['General']['cur_commit_branch'] = CUR_COMMIT_BRANCH
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['General']['config_version'] = CONFIG_VERSION
|
|
|
|
new_config['General']['encryption_version'] = int(ENCRYPTION_VERSION)
|
|
|
|
new_config['General']['log_dir'] = ACTUAL_LOG_DIR if ACTUAL_LOG_DIR else 'Logs'
|
|
|
|
new_config['General']['socket_timeout'] = SOCKET_TIMEOUT
|
|
|
|
new_config['General']['web_port'] = WEB_PORT
|
|
|
|
new_config['General']['web_host'] = WEB_HOST
|
|
|
|
new_config['General']['web_ipv6'] = int(WEB_IPV6)
|
|
|
|
new_config['General']['web_log'] = int(WEB_LOG)
|
|
|
|
new_config['General']['web_root'] = WEB_ROOT
|
|
|
|
new_config['General']['web_username'] = WEB_USERNAME
|
|
|
|
new_config['General']['web_password'] = helpers.encrypt(WEB_PASSWORD, ENCRYPTION_VERSION)
|
2014-07-11 07:05:33 -04:00
|
|
|
new_config['General']['play_videos'] = int(PLAY_VIDEOS)
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['General']['localhost_ip'] = LOCALHOST_IP
|
2014-05-17 07:40:26 -04:00
|
|
|
new_config['General']['cpu_preset'] = CPU_PRESET
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['General']['anon_redirect'] = ANON_REDIRECT
|
|
|
|
new_config['General']['use_api'] = int(USE_API)
|
|
|
|
new_config['General']['api_key'] = API_KEY
|
2014-04-28 18:22:44 -04:00
|
|
|
new_config['General']['debug'] = int(DEBUG)
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['General']['enable_https'] = int(ENABLE_HTTPS)
|
|
|
|
new_config['General']['https_cert'] = HTTPS_CERT
|
|
|
|
new_config['General']['https_key'] = HTTPS_KEY
|
2014-05-04 14:47:09 -04:00
|
|
|
new_config['General']['handle_reverse_proxy'] = int(HANDLE_REVERSE_PROXY)
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['General']['use_nzbs'] = int(USE_NZBS)
|
|
|
|
new_config['General']['use_torrents'] = int(USE_TORRENTS)
|
|
|
|
new_config['General']['nzb_method'] = NZB_METHOD
|
|
|
|
new_config['General']['torrent_method'] = TORRENT_METHOD
|
|
|
|
new_config['General']['usenet_retention'] = int(USENET_RETENTION)
|
2014-05-21 16:26:24 -04:00
|
|
|
new_config['General']['autopostprocesser_frequency'] = int(AUTOPOSTPROCESSER_FREQUENCY)
|
2014-05-15 00:16:46 -04:00
|
|
|
new_config['General']['dailysearch_frequency'] = int(DAILYSEARCH_FREQUENCY)
|
2014-05-12 06:34:18 -04:00
|
|
|
new_config['General']['backlog_frequency'] = int(BACKLOG_FREQUENCY)
|
2014-04-26 17:24:29 -04:00
|
|
|
new_config['General']['update_frequency'] = int(UPDATE_FREQUENCY)
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['General']['download_propers'] = int(DOWNLOAD_PROPERS)
|
2014-05-14 18:23:59 -04:00
|
|
|
new_config['General']['check_propers_interval'] = CHECK_PROPERS_INTERVAL
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['General']['allow_high_priority'] = int(ALLOW_HIGH_PRIORITY)
|
2014-05-17 12:18:50 -04:00
|
|
|
new_config['General']['dailysearch_startup'] = int(DAILYSEARCH_STARTUP)
|
2014-05-07 08:54:52 -04:00
|
|
|
new_config['General']['backlog_startup'] = int(BACKLOG_STARTUP)
|
2014-05-17 18:14:31 -04:00
|
|
|
new_config['General']['skip_removed_files'] = int(SKIP_REMOVED_FILES)
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['General']['quality_default'] = int(QUALITY_DEFAULT)
|
|
|
|
new_config['General']['status_default'] = int(STATUS_DEFAULT)
|
|
|
|
new_config['General']['flatten_folders_default'] = int(FLATTEN_FOLDERS_DEFAULT)
|
2014-04-27 04:17:28 -04:00
|
|
|
new_config['General']['indexer_default'] = int(INDEXER_DEFAULT)
|
2014-05-21 14:17:52 -04:00
|
|
|
new_config['General']['indexer_timeout'] = int(INDEXER_TIMEOUT)
|
2014-05-26 02:29:22 -04:00
|
|
|
new_config['General']['anime_default'] = int(ANIME_DEFAULT)
|
2014-06-01 23:43:37 -04:00
|
|
|
new_config['General']['scene_default'] = int(SCENE_DEFAULT)
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['General']['provider_order'] = ' '.join(PROVIDER_ORDER)
|
|
|
|
new_config['General']['version_notify'] = int(VERSION_NOTIFY)
|
2014-04-23 03:12:51 -04:00
|
|
|
new_config['General']['auto_update'] = int(AUTO_UPDATE)
|
2014-07-03 03:16:15 -04:00
|
|
|
new_config['General']['notify_on_update'] = int(NOTIFY_ON_UPDATE)
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['General']['naming_strip_year'] = int(NAMING_STRIP_YEAR)
|
|
|
|
new_config['General']['naming_pattern'] = NAMING_PATTERN
|
|
|
|
new_config['General']['naming_custom_abd'] = int(NAMING_CUSTOM_ABD)
|
|
|
|
new_config['General']['naming_abd_pattern'] = NAMING_ABD_PATTERN
|
2014-04-28 05:15:29 -04:00
|
|
|
new_config['General']['naming_custom_sports'] = int(NAMING_CUSTOM_SPORTS)
|
|
|
|
new_config['General']['naming_sports_pattern'] = NAMING_SPORTS_PATTERN
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['General']['naming_multi_ep'] = int(NAMING_MULTI_EP)
|
2014-05-26 02:29:22 -04:00
|
|
|
new_config['General']['naming_anime'] = int(NAMING_ANIME)
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['General']['launch_browser'] = int(LAUNCH_BROWSER)
|
|
|
|
new_config['General']['update_shows_on_start'] = int(UPDATE_SHOWS_ON_START)
|
|
|
|
new_config['General']['sort_article'] = int(SORT_ARTICLE)
|
2014-04-25 07:11:52 -04:00
|
|
|
new_config['General']['proxy_setting'] = PROXY_SETTING
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
new_config['General']['use_listview'] = int(USE_LISTVIEW)
|
|
|
|
new_config['General']['metadata_xbmc'] = METADATA_XBMC
|
|
|
|
new_config['General']['metadata_xbmc_12plus'] = METADATA_XBMC_12PLUS
|
|
|
|
new_config['General']['metadata_mediabrowser'] = METADATA_MEDIABROWSER
|
|
|
|
new_config['General']['metadata_ps3'] = METADATA_PS3
|
|
|
|
new_config['General']['metadata_wdtv'] = METADATA_WDTV
|
|
|
|
new_config['General']['metadata_tivo'] = METADATA_TIVO
|
2014-05-11 19:15:24 -04:00
|
|
|
new_config['General']['metadata_mede8er'] = METADATA_MEDE8ER
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
new_config['General']['cache_dir'] = ACTUAL_CACHE_DIR if ACTUAL_CACHE_DIR else 'cache'
|
|
|
|
new_config['General']['root_dirs'] = ROOT_DIRS if ROOT_DIRS else ''
|
|
|
|
new_config['General']['tv_download_dir'] = TV_DOWNLOAD_DIR
|
|
|
|
new_config['General']['keep_processed_dir'] = int(KEEP_PROCESSED_DIR)
|
|
|
|
new_config['General']['process_method'] = PROCESS_METHOD
|
|
|
|
new_config['General']['move_associated_files'] = int(MOVE_ASSOCIATED_FILES)
|
2014-09-07 06:45:19 -04:00
|
|
|
new_config['General']['postpone_if_sync_files'] = int (POSTPONE_IF_SYNC_FILES)
|
2014-04-06 12:25:46 -04:00
|
|
|
new_config['General']['nfo_rename'] = int(NFO_RENAME)
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['General']['process_automatically'] = int(PROCESS_AUTOMATICALLY)
|
|
|
|
new_config['General']['unpack'] = int(UNPACK)
|
|
|
|
new_config['General']['rename_episodes'] = int(RENAME_EPISODES)
|
2014-05-14 08:33:36 -04:00
|
|
|
new_config['General']['airdate_episodes'] = int(AIRDATE_EPISODES)
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['General']['create_missing_show_dirs'] = int(CREATE_MISSING_SHOW_DIRS)
|
|
|
|
new_config['General']['add_shows_wo_dir'] = int(ADD_SHOWS_WO_DIR)
|
|
|
|
|
|
|
|
new_config['General']['extra_scripts'] = '|'.join(EXTRA_SCRIPTS)
|
|
|
|
new_config['General']['git_path'] = GIT_PATH
|
|
|
|
new_config['General']['ignore_words'] = IGNORE_WORDS
|
|
|
|
new_config['General']['calendar_unprotected'] = int(CALENDAR_UNPROTECTED)
|
|
|
|
|
|
|
|
new_config['Blackhole'] = {}
|
|
|
|
new_config['Blackhole']['nzb_dir'] = NZB_DIR
|
|
|
|
new_config['Blackhole']['torrent_dir'] = TORRENT_DIR
|
|
|
|
|
2014-05-17 01:23:11 -04:00
|
|
|
# dynamically save provider settings
|
|
|
|
for curTorrentProvider in [curProvider for curProvider in providers.sortedProviderList() if
|
|
|
|
curProvider.providerType == GenericProvider.TORRENT]:
|
|
|
|
new_config[curTorrentProvider.getID().upper()] = {}
|
|
|
|
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID()] = int(curTorrentProvider.enabled)
|
|
|
|
if hasattr(curTorrentProvider, 'digest'):
|
2014-05-17 07:40:26 -04:00
|
|
|
new_config[curTorrentProvider.getID().upper()][
|
|
|
|
curTorrentProvider.getID() + '_digest'] = curTorrentProvider.digest
|
2014-05-17 01:23:11 -04:00
|
|
|
if hasattr(curTorrentProvider, 'hash'):
|
2014-05-17 07:40:26 -04:00
|
|
|
new_config[curTorrentProvider.getID().upper()][
|
|
|
|
curTorrentProvider.getID() + '_hash'] = curTorrentProvider.hash
|
2014-05-17 01:23:11 -04:00
|
|
|
if hasattr(curTorrentProvider, 'api_key'):
|
2014-05-17 07:40:26 -04:00
|
|
|
new_config[curTorrentProvider.getID().upper()][
|
|
|
|
curTorrentProvider.getID() + '_api_key'] = curTorrentProvider.api_key
|
2014-05-17 01:23:11 -04:00
|
|
|
if hasattr(curTorrentProvider, 'username'):
|
2014-05-17 07:40:26 -04:00
|
|
|
new_config[curTorrentProvider.getID().upper()][
|
|
|
|
curTorrentProvider.getID() + '_username'] = curTorrentProvider.username
|
2014-05-17 01:23:11 -04:00
|
|
|
if hasattr(curTorrentProvider, 'password'):
|
2014-05-17 07:40:26 -04:00
|
|
|
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_password'] = helpers.encrypt(
|
|
|
|
curTorrentProvider.password, ENCRYPTION_VERSION)
|
2014-05-19 16:06:32 -04:00
|
|
|
if hasattr(curTorrentProvider, 'passkey'):
|
|
|
|
new_config[curTorrentProvider.getID().upper()][
|
|
|
|
curTorrentProvider.getID() + '_passkey'] = curTorrentProvider.passkey
|
2014-05-17 01:23:11 -04:00
|
|
|
if hasattr(curTorrentProvider, 'confirmed'):
|
2014-05-17 07:40:26 -04:00
|
|
|
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_confirmed'] = int(
|
|
|
|
curTorrentProvider.confirmed)
|
2014-05-17 01:23:11 -04:00
|
|
|
if hasattr(curTorrentProvider, 'ratio'):
|
2014-05-23 02:42:11 -04:00
|
|
|
new_config[curTorrentProvider.getID().upper()][
|
|
|
|
curTorrentProvider.getID() + '_ratio'] = curTorrentProvider.ratio
|
2014-05-20 12:06:11 -04:00
|
|
|
if hasattr(curTorrentProvider, 'minseed'):
|
|
|
|
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_minseed'] = int(
|
|
|
|
curTorrentProvider.minseed)
|
|
|
|
if hasattr(curTorrentProvider, 'minleech'):
|
|
|
|
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_minleech'] = int(
|
|
|
|
curTorrentProvider.minleech)
|
2014-05-17 01:23:11 -04:00
|
|
|
if hasattr(curTorrentProvider, 'options'):
|
2014-05-17 07:40:26 -04:00
|
|
|
new_config[curTorrentProvider.getID().upper()][
|
|
|
|
curTorrentProvider.getID() + '_options'] = curTorrentProvider.options
|
2014-05-17 01:23:11 -04:00
|
|
|
if hasattr(curTorrentProvider, 'proxy'):
|
2014-05-17 07:40:26 -04:00
|
|
|
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_proxy'] = int(
|
|
|
|
curTorrentProvider.proxy.enabled)
|
2014-05-17 02:38:00 -04:00
|
|
|
if hasattr(curTorrentProvider.proxy, 'url'):
|
2014-05-17 07:40:26 -04:00
|
|
|
new_config[curTorrentProvider.getID().upper()][
|
|
|
|
curTorrentProvider.getID() + '_proxy_url'] = curTorrentProvider.proxy.url
|
2014-05-17 01:23:11 -04:00
|
|
|
if hasattr(curTorrentProvider, 'freeleech'):
|
2014-05-17 07:40:26 -04:00
|
|
|
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_freeleech'] = int(
|
|
|
|
curTorrentProvider.freeleech)
|
2014-05-17 01:23:11 -04:00
|
|
|
if hasattr(curTorrentProvider, 'search_mode'):
|
2014-05-17 07:40:26 -04:00
|
|
|
new_config[curTorrentProvider.getID().upper()][
|
|
|
|
curTorrentProvider.getID() + '_search_mode'] = curTorrentProvider.search_mode
|
2014-05-17 01:23:11 -04:00
|
|
|
if hasattr(curTorrentProvider, 'search_fallback'):
|
2014-05-17 07:40:26 -04:00
|
|
|
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_search_fallback'] = int(
|
|
|
|
curTorrentProvider.search_fallback)
|
2014-08-29 01:16:25 -04:00
|
|
|
if hasattr(curTorrentProvider, 'enable_daily'):
|
|
|
|
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_enable_daily'] = int(
|
|
|
|
curTorrentProvider.enable_daily)
|
|
|
|
if hasattr(curTorrentProvider, 'enable_backlog'):
|
|
|
|
new_config[curTorrentProvider.getID().upper()][curTorrentProvider.getID() + '_enable_backlog'] = int(
|
|
|
|
curTorrentProvider.enable_backlog)
|
2014-04-26 09:35:37 -04:00
|
|
|
|
2014-05-19 22:14:06 -04:00
|
|
|
for curNzbProvider in [curProvider for curProvider in providers.sortedProviderList() if
|
|
|
|
curProvider.providerType == GenericProvider.NZB]:
|
|
|
|
new_config[curNzbProvider.getID().upper()] = {}
|
|
|
|
new_config[curNzbProvider.getID().upper()][curNzbProvider.getID()] = int(curNzbProvider.enabled)
|
|
|
|
|
|
|
|
if hasattr(curNzbProvider, 'api_key'):
|
|
|
|
new_config[curNzbProvider.getID().upper()][
|
|
|
|
curNzbProvider.getID() + '_api_key'] = curNzbProvider.api_key
|
|
|
|
if hasattr(curNzbProvider, 'username'):
|
|
|
|
new_config[curNzbProvider.getID().upper()][
|
|
|
|
curNzbProvider.getID() + '_username'] = curNzbProvider.username
|
2014-05-19 22:29:51 -04:00
|
|
|
if hasattr(curNzbProvider, 'search_mode'):
|
|
|
|
new_config[curNzbProvider.getID().upper()][
|
|
|
|
curNzbProvider.getID() + '_search_mode'] = curNzbProvider.search_mode
|
|
|
|
if hasattr(curNzbProvider, 'search_fallback'):
|
|
|
|
new_config[curNzbProvider.getID().upper()][curNzbProvider.getID() + '_search_fallback'] = int(
|
|
|
|
curNzbProvider.search_fallback)
|
2014-08-29 01:16:25 -04:00
|
|
|
if hasattr(curNzbProvider, 'enable_daily'):
|
|
|
|
new_config[curNzbProvider.getID().upper()][curNzbProvider.getID() + '_enable_daily'] = int(
|
|
|
|
curNzbProvider.enable_daily)
|
|
|
|
if hasattr(curNzbProvider, 'enable_backlog'):
|
|
|
|
new_config[curNzbProvider.getID().upper()][curNzbProvider.getID() + '_enable_backlog'] = int(
|
|
|
|
curNzbProvider.enable_backlog)
|
2014-05-19 22:14:06 -04:00
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['NZBs'] = {}
|
|
|
|
new_config['NZBs']['nzbs'] = int(NZBS)
|
|
|
|
new_config['NZBs']['nzbs_uid'] = NZBS_UID
|
|
|
|
new_config['NZBs']['nzbs_hash'] = NZBS_HASH
|
|
|
|
|
|
|
|
new_config['Newzbin'] = {}
|
|
|
|
new_config['Newzbin']['newzbin'] = int(NEWZBIN)
|
|
|
|
new_config['Newzbin']['newzbin_username'] = NEWZBIN_USERNAME
|
|
|
|
new_config['Newzbin']['newzbin_password'] = helpers.encrypt(NEWZBIN_PASSWORD, ENCRYPTION_VERSION)
|
|
|
|
|
|
|
|
new_config['SABnzbd'] = {}
|
|
|
|
new_config['SABnzbd']['sab_username'] = SAB_USERNAME
|
|
|
|
new_config['SABnzbd']['sab_password'] = helpers.encrypt(SAB_PASSWORD, ENCRYPTION_VERSION)
|
|
|
|
new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY
|
|
|
|
new_config['SABnzbd']['sab_category'] = SAB_CATEGORY
|
|
|
|
new_config['SABnzbd']['sab_host'] = SAB_HOST
|
|
|
|
|
|
|
|
new_config['NZBget'] = {}
|
|
|
|
|
2014-03-25 01:57:24 -04:00
|
|
|
new_config['NZBget']['nzbget_username'] = NZBGET_USERNAME
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['NZBget']['nzbget_password'] = helpers.encrypt(NZBGET_PASSWORD, ENCRYPTION_VERSION)
|
|
|
|
new_config['NZBget']['nzbget_category'] = NZBGET_CATEGORY
|
|
|
|
new_config['NZBget']['nzbget_host'] = NZBGET_HOST
|
2014-05-05 18:48:28 -04:00
|
|
|
new_config['NZBget']['nzbget_use_https'] = int(NZBGET_USE_HTTPS)
|
2014-08-11 16:07:02 -04:00
|
|
|
new_config['NZBget']['nzbget_priority'] = NZBGET_PRIORITY
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
new_config['TORRENT'] = {}
|
|
|
|
new_config['TORRENT']['torrent_username'] = TORRENT_USERNAME
|
|
|
|
new_config['TORRENT']['torrent_password'] = helpers.encrypt(TORRENT_PASSWORD, ENCRYPTION_VERSION)
|
|
|
|
new_config['TORRENT']['torrent_host'] = TORRENT_HOST
|
|
|
|
new_config['TORRENT']['torrent_path'] = TORRENT_PATH
|
2014-05-12 03:05:16 -04:00
|
|
|
new_config['TORRENT']['torrent_seed_time'] = int(TORRENT_SEED_TIME)
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['TORRENT']['torrent_paused'] = int(TORRENT_PAUSED)
|
|
|
|
new_config['TORRENT']['torrent_high_bandwidth'] = int(TORRENT_HIGH_BANDWIDTH)
|
|
|
|
new_config['TORRENT']['torrent_label'] = TORRENT_LABEL
|
2014-05-11 03:42:53 -04:00
|
|
|
new_config['TORRENT']['torrent_verify_cert'] = int(TORRENT_VERIFY_CERT)
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
new_config['XBMC'] = {}
|
|
|
|
new_config['XBMC']['use_xbmc'] = int(USE_XBMC)
|
2014-05-08 11:54:43 -04:00
|
|
|
new_config['XBMC']['xbmc_always_on'] = int(XBMC_ALWAYS_ON)
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['XBMC']['xbmc_notify_onsnatch'] = int(XBMC_NOTIFY_ONSNATCH)
|
|
|
|
new_config['XBMC']['xbmc_notify_ondownload'] = int(XBMC_NOTIFY_ONDOWNLOAD)
|
|
|
|
new_config['XBMC']['xbmc_notify_onsubtitledownload'] = int(XBMC_NOTIFY_ONSUBTITLEDOWNLOAD)
|
|
|
|
new_config['XBMC']['xbmc_update_library'] = int(XBMC_UPDATE_LIBRARY)
|
|
|
|
new_config['XBMC']['xbmc_update_full'] = int(XBMC_UPDATE_FULL)
|
|
|
|
new_config['XBMC']['xbmc_update_onlyfirst'] = int(XBMC_UPDATE_ONLYFIRST)
|
|
|
|
new_config['XBMC']['xbmc_host'] = XBMC_HOST
|
|
|
|
new_config['XBMC']['xbmc_username'] = XBMC_USERNAME
|
|
|
|
new_config['XBMC']['xbmc_password'] = helpers.encrypt(XBMC_PASSWORD, ENCRYPTION_VERSION)
|
|
|
|
|
|
|
|
new_config['Plex'] = {}
|
|
|
|
new_config['Plex']['use_plex'] = int(USE_PLEX)
|
|
|
|
new_config['Plex']['plex_notify_onsnatch'] = int(PLEX_NOTIFY_ONSNATCH)
|
|
|
|
new_config['Plex']['plex_notify_ondownload'] = int(PLEX_NOTIFY_ONDOWNLOAD)
|
|
|
|
new_config['Plex']['plex_notify_onsubtitledownload'] = int(PLEX_NOTIFY_ONSUBTITLEDOWNLOAD)
|
|
|
|
new_config['Plex']['plex_update_library'] = int(PLEX_UPDATE_LIBRARY)
|
|
|
|
new_config['Plex']['plex_server_host'] = PLEX_SERVER_HOST
|
|
|
|
new_config['Plex']['plex_host'] = PLEX_HOST
|
|
|
|
new_config['Plex']['plex_username'] = PLEX_USERNAME
|
|
|
|
new_config['Plex']['plex_password'] = helpers.encrypt(PLEX_PASSWORD, ENCRYPTION_VERSION)
|
|
|
|
|
|
|
|
new_config['Growl'] = {}
|
|
|
|
new_config['Growl']['use_growl'] = int(USE_GROWL)
|
|
|
|
new_config['Growl']['growl_notify_onsnatch'] = int(GROWL_NOTIFY_ONSNATCH)
|
|
|
|
new_config['Growl']['growl_notify_ondownload'] = int(GROWL_NOTIFY_ONDOWNLOAD)
|
|
|
|
new_config['Growl']['growl_notify_onsubtitledownload'] = int(GROWL_NOTIFY_ONSUBTITLEDOWNLOAD)
|
|
|
|
new_config['Growl']['growl_host'] = GROWL_HOST
|
|
|
|
new_config['Growl']['growl_password'] = helpers.encrypt(GROWL_PASSWORD, ENCRYPTION_VERSION)
|
|
|
|
|
|
|
|
new_config['Prowl'] = {}
|
|
|
|
new_config['Prowl']['use_prowl'] = int(USE_PROWL)
|
|
|
|
new_config['Prowl']['prowl_notify_onsnatch'] = int(PROWL_NOTIFY_ONSNATCH)
|
|
|
|
new_config['Prowl']['prowl_notify_ondownload'] = int(PROWL_NOTIFY_ONDOWNLOAD)
|
|
|
|
new_config['Prowl']['prowl_notify_onsubtitledownload'] = int(PROWL_NOTIFY_ONSUBTITLEDOWNLOAD)
|
|
|
|
new_config['Prowl']['prowl_api'] = PROWL_API
|
|
|
|
new_config['Prowl']['prowl_priority'] = PROWL_PRIORITY
|
|
|
|
|
|
|
|
new_config['Twitter'] = {}
|
|
|
|
new_config['Twitter']['use_twitter'] = int(USE_TWITTER)
|
|
|
|
new_config['Twitter']['twitter_notify_onsnatch'] = int(TWITTER_NOTIFY_ONSNATCH)
|
|
|
|
new_config['Twitter']['twitter_notify_ondownload'] = int(TWITTER_NOTIFY_ONDOWNLOAD)
|
|
|
|
new_config['Twitter']['twitter_notify_onsubtitledownload'] = int(TWITTER_NOTIFY_ONSUBTITLEDOWNLOAD)
|
|
|
|
new_config['Twitter']['twitter_username'] = TWITTER_USERNAME
|
|
|
|
new_config['Twitter']['twitter_password'] = helpers.encrypt(TWITTER_PASSWORD, ENCRYPTION_VERSION)
|
|
|
|
new_config['Twitter']['twitter_prefix'] = TWITTER_PREFIX
|
|
|
|
|
|
|
|
new_config['Boxcar'] = {}
|
|
|
|
new_config['Boxcar']['use_boxcar'] = int(USE_BOXCAR)
|
|
|
|
new_config['Boxcar']['boxcar_notify_onsnatch'] = int(BOXCAR_NOTIFY_ONSNATCH)
|
|
|
|
new_config['Boxcar']['boxcar_notify_ondownload'] = int(BOXCAR_NOTIFY_ONDOWNLOAD)
|
|
|
|
new_config['Boxcar']['boxcar_notify_onsubtitledownload'] = int(BOXCAR_NOTIFY_ONSUBTITLEDOWNLOAD)
|
|
|
|
new_config['Boxcar']['boxcar_username'] = BOXCAR_USERNAME
|
|
|
|
|
2014-05-07 10:23:06 -04:00
|
|
|
new_config['Boxcar2'] = {}
|
|
|
|
new_config['Boxcar2']['use_boxcar2'] = int(USE_BOXCAR2)
|
|
|
|
new_config['Boxcar2']['boxcar2_notify_onsnatch'] = int(BOXCAR2_NOTIFY_ONSNATCH)
|
|
|
|
new_config['Boxcar2']['boxcar2_notify_ondownload'] = int(BOXCAR2_NOTIFY_ONDOWNLOAD)
|
|
|
|
new_config['Boxcar2']['boxcar2_notify_onsubtitledownload'] = int(BOXCAR2_NOTIFY_ONSUBTITLEDOWNLOAD)
|
|
|
|
new_config['Boxcar2']['boxcar2_accesstoken'] = BOXCAR2_ACCESSTOKEN
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['Pushover'] = {}
|
|
|
|
new_config['Pushover']['use_pushover'] = int(USE_PUSHOVER)
|
|
|
|
new_config['Pushover']['pushover_notify_onsnatch'] = int(PUSHOVER_NOTIFY_ONSNATCH)
|
|
|
|
new_config['Pushover']['pushover_notify_ondownload'] = int(PUSHOVER_NOTIFY_ONDOWNLOAD)
|
|
|
|
new_config['Pushover']['pushover_notify_onsubtitledownload'] = int(PUSHOVER_NOTIFY_ONSUBTITLEDOWNLOAD)
|
|
|
|
new_config['Pushover']['pushover_userkey'] = PUSHOVER_USERKEY
|
2014-06-17 16:37:09 -04:00
|
|
|
new_config['Pushover']['pushover_apikey'] = PUSHOVER_APIKEY
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
new_config['Libnotify'] = {}
|
|
|
|
new_config['Libnotify']['use_libnotify'] = int(USE_LIBNOTIFY)
|
|
|
|
new_config['Libnotify']['libnotify_notify_onsnatch'] = int(LIBNOTIFY_NOTIFY_ONSNATCH)
|
|
|
|
new_config['Libnotify']['libnotify_notify_ondownload'] = int(LIBNOTIFY_NOTIFY_ONDOWNLOAD)
|
|
|
|
new_config['Libnotify']['libnotify_notify_onsubtitledownload'] = int(LIBNOTIFY_NOTIFY_ONSUBTITLEDOWNLOAD)
|
|
|
|
|
|
|
|
new_config['NMJ'] = {}
|
|
|
|
new_config['NMJ']['use_nmj'] = int(USE_NMJ)
|
|
|
|
new_config['NMJ']['nmj_host'] = NMJ_HOST
|
|
|
|
new_config['NMJ']['nmj_database'] = NMJ_DATABASE
|
|
|
|
new_config['NMJ']['nmj_mount'] = NMJ_MOUNT
|
|
|
|
|
|
|
|
new_config['NMJv2'] = {}
|
|
|
|
new_config['NMJv2']['use_nmjv2'] = int(USE_NMJv2)
|
|
|
|
new_config['NMJv2']['nmjv2_host'] = NMJv2_HOST
|
|
|
|
new_config['NMJv2']['nmjv2_database'] = NMJv2_DATABASE
|
|
|
|
new_config['NMJv2']['nmjv2_dbloc'] = NMJv2_DBLOC
|
|
|
|
|
|
|
|
new_config['Synology'] = {}
|
|
|
|
new_config['Synology']['use_synoindex'] = int(USE_SYNOINDEX)
|
|
|
|
|
|
|
|
new_config['SynologyNotifier'] = {}
|
|
|
|
new_config['SynologyNotifier']['use_synologynotifier'] = int(USE_SYNOLOGYNOTIFIER)
|
|
|
|
new_config['SynologyNotifier']['synologynotifier_notify_onsnatch'] = int(SYNOLOGYNOTIFIER_NOTIFY_ONSNATCH)
|
|
|
|
new_config['SynologyNotifier']['synologynotifier_notify_ondownload'] = int(SYNOLOGYNOTIFIER_NOTIFY_ONDOWNLOAD)
|
2014-03-25 01:57:24 -04:00
|
|
|
new_config['SynologyNotifier']['synologynotifier_notify_onsubtitledownload'] = int(
|
|
|
|
SYNOLOGYNOTIFIER_NOTIFY_ONSUBTITLEDOWNLOAD)
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
new_config['Trakt'] = {}
|
|
|
|
new_config['Trakt']['use_trakt'] = int(USE_TRAKT)
|
|
|
|
new_config['Trakt']['trakt_username'] = TRAKT_USERNAME
|
|
|
|
new_config['Trakt']['trakt_password'] = helpers.encrypt(TRAKT_PASSWORD, ENCRYPTION_VERSION)
|
|
|
|
new_config['Trakt']['trakt_api'] = TRAKT_API
|
|
|
|
new_config['Trakt']['trakt_remove_watchlist'] = int(TRAKT_REMOVE_WATCHLIST)
|
2014-08-11 07:29:35 -04:00
|
|
|
new_config['Trakt']['trakt_remove_serieslist'] = int(TRAKT_REMOVE_SERIESLIST)
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['Trakt']['trakt_use_watchlist'] = int(TRAKT_USE_WATCHLIST)
|
2014-07-27 06:59:21 -04:00
|
|
|
new_config['Trakt']['trakt_method_add'] = int(TRAKT_METHOD_ADD)
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['Trakt']['trakt_start_paused'] = int(TRAKT_START_PAUSED)
|
2014-06-28 23:28:00 -04:00
|
|
|
new_config['Trakt']['trakt_use_recommended'] = int(TRAKT_USE_RECOMMENDED)
|
2014-06-29 01:54:29 -04:00
|
|
|
new_config['Trakt']['trakt_sync'] = int(TRAKT_SYNC)
|
2014-07-24 00:44:11 -04:00
|
|
|
new_config['Trakt']['trakt_default_indexer'] = int(TRAKT_DEFAULT_INDEXER)
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
new_config['pyTivo'] = {}
|
|
|
|
new_config['pyTivo']['use_pytivo'] = int(USE_PYTIVO)
|
|
|
|
new_config['pyTivo']['pytivo_notify_onsnatch'] = int(PYTIVO_NOTIFY_ONSNATCH)
|
|
|
|
new_config['pyTivo']['pytivo_notify_ondownload'] = int(PYTIVO_NOTIFY_ONDOWNLOAD)
|
|
|
|
new_config['pyTivo']['pytivo_notify_onsubtitledownload'] = int(PYTIVO_NOTIFY_ONSUBTITLEDOWNLOAD)
|
|
|
|
new_config['pyTivo']['pyTivo_update_library'] = int(PYTIVO_UPDATE_LIBRARY)
|
|
|
|
new_config['pyTivo']['pytivo_host'] = PYTIVO_HOST
|
|
|
|
new_config['pyTivo']['pytivo_share_name'] = PYTIVO_SHARE_NAME
|
|
|
|
new_config['pyTivo']['pytivo_tivo_name'] = PYTIVO_TIVO_NAME
|
|
|
|
|
|
|
|
new_config['NMA'] = {}
|
|
|
|
new_config['NMA']['use_nma'] = int(USE_NMA)
|
|
|
|
new_config['NMA']['nma_notify_onsnatch'] = int(NMA_NOTIFY_ONSNATCH)
|
|
|
|
new_config['NMA']['nma_notify_ondownload'] = int(NMA_NOTIFY_ONDOWNLOAD)
|
|
|
|
new_config['NMA']['nma_notify_onsubtitledownload'] = int(NMA_NOTIFY_ONSUBTITLEDOWNLOAD)
|
|
|
|
new_config['NMA']['nma_api'] = NMA_API
|
|
|
|
new_config['NMA']['nma_priority'] = NMA_PRIORITY
|
|
|
|
|
|
|
|
new_config['Pushalot'] = {}
|
|
|
|
new_config['Pushalot']['use_pushalot'] = int(USE_PUSHALOT)
|
|
|
|
new_config['Pushalot']['pushalot_notify_onsnatch'] = int(PUSHALOT_NOTIFY_ONSNATCH)
|
|
|
|
new_config['Pushalot']['pushalot_notify_ondownload'] = int(PUSHALOT_NOTIFY_ONDOWNLOAD)
|
|
|
|
new_config['Pushalot']['pushalot_notify_onsubtitledownload'] = int(PUSHALOT_NOTIFY_ONSUBTITLEDOWNLOAD)
|
|
|
|
new_config['Pushalot']['pushalot_authorizationtoken'] = PUSHALOT_AUTHORIZATIONTOKEN
|
|
|
|
|
|
|
|
new_config['Pushbullet'] = {}
|
|
|
|
new_config['Pushbullet']['use_pushbullet'] = int(USE_PUSHBULLET)
|
|
|
|
new_config['Pushbullet']['pushbullet_notify_onsnatch'] = int(PUSHBULLET_NOTIFY_ONSNATCH)
|
|
|
|
new_config['Pushbullet']['pushbullet_notify_ondownload'] = int(PUSHBULLET_NOTIFY_ONDOWNLOAD)
|
|
|
|
new_config['Pushbullet']['pushbullet_notify_onsubtitledownload'] = int(PUSHBULLET_NOTIFY_ONSUBTITLEDOWNLOAD)
|
|
|
|
new_config['Pushbullet']['pushbullet_api'] = PUSHBULLET_API
|
|
|
|
new_config['Pushbullet']['pushbullet_device'] = PUSHBULLET_DEVICE
|
|
|
|
|
|
|
|
new_config['Email'] = {}
|
|
|
|
new_config['Email']['use_email'] = int(USE_EMAIL)
|
|
|
|
new_config['Email']['email_notify_onsnatch'] = int(EMAIL_NOTIFY_ONSNATCH)
|
|
|
|
new_config['Email']['email_notify_ondownload'] = int(EMAIL_NOTIFY_ONDOWNLOAD)
|
|
|
|
new_config['Email']['email_notify_onsubtitledownload'] = int(EMAIL_NOTIFY_ONSUBTITLEDOWNLOAD)
|
|
|
|
new_config['Email']['email_host'] = EMAIL_HOST
|
|
|
|
new_config['Email']['email_port'] = int(EMAIL_PORT)
|
|
|
|
new_config['Email']['email_tls'] = int(EMAIL_TLS)
|
|
|
|
new_config['Email']['email_user'] = EMAIL_USER
|
|
|
|
new_config['Email']['email_password'] = helpers.encrypt(EMAIL_PASSWORD, ENCRYPTION_VERSION)
|
|
|
|
new_config['Email']['email_from'] = EMAIL_FROM
|
|
|
|
new_config['Email']['email_list'] = EMAIL_LIST
|
|
|
|
|
|
|
|
new_config['Newznab'] = {}
|
|
|
|
new_config['Newznab']['newznab_data'] = NEWZNAB_DATA
|
|
|
|
|
|
|
|
new_config['TorrentRss'] = {}
|
|
|
|
new_config['TorrentRss']['torrentrss_data'] = '!!!'.join([x.configStr() for x in torrentRssProviderList])
|
|
|
|
|
|
|
|
new_config['GUI'] = {}
|
|
|
|
new_config['GUI']['gui_name'] = GUI_NAME
|
|
|
|
new_config['GUI']['home_layout'] = HOME_LAYOUT
|
|
|
|
new_config['GUI']['history_layout'] = HISTORY_LAYOUT
|
|
|
|
new_config['GUI']['display_show_specials'] = int(DISPLAY_SHOW_SPECIALS)
|
|
|
|
new_config['GUI']['coming_eps_layout'] = COMING_EPS_LAYOUT
|
|
|
|
new_config['GUI']['coming_eps_display_paused'] = int(COMING_EPS_DISPLAY_PAUSED)
|
|
|
|
new_config['GUI']['coming_eps_sort'] = COMING_EPS_SORT
|
|
|
|
new_config['GUI']['coming_eps_missed_range'] = int(COMING_EPS_MISSED_RANGE)
|
2014-05-23 11:20:44 -04:00
|
|
|
new_config['GUI']['fuzzy_dating'] = int(FUZZY_DATING)
|
|
|
|
new_config['GUI']['trim_zero'] = int(TRIM_ZERO)
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['GUI']['date_preset'] = DATE_PRESET
|
|
|
|
new_config['GUI']['time_preset'] = TIME_PRESET_W_SECONDS
|
2014-05-17 03:30:21 -04:00
|
|
|
new_config['GUI']['timezone_display'] = TIMEZONE_DISPLAY
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
new_config['Subtitles'] = {}
|
|
|
|
new_config['Subtitles']['use_subtitles'] = int(USE_SUBTITLES)
|
|
|
|
new_config['Subtitles']['subtitles_languages'] = ','.join(SUBTITLES_LANGUAGES)
|
|
|
|
new_config['Subtitles']['SUBTITLES_SERVICES_LIST'] = ','.join(SUBTITLES_SERVICES_LIST)
|
|
|
|
new_config['Subtitles']['SUBTITLES_SERVICES_ENABLED'] = '|'.join([str(x) for x in SUBTITLES_SERVICES_ENABLED])
|
|
|
|
new_config['Subtitles']['subtitles_dir'] = SUBTITLES_DIR
|
|
|
|
new_config['Subtitles']['subtitles_default'] = int(SUBTITLES_DEFAULT)
|
|
|
|
new_config['Subtitles']['subtitles_history'] = int(SUBTITLES_HISTORY)
|
|
|
|
new_config['Subtitles']['subtitles_finder_frequency'] = int(SUBTITLES_FINDER_FREQUENCY)
|
|
|
|
|
2014-03-25 01:57:24 -04:00
|
|
|
new_config['FailedDownloads'] = {}
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config['FailedDownloads']['use_failed_downloads'] = int(USE_FAILED_DOWNLOADS)
|
|
|
|
new_config['FailedDownloads']['delete_failed'] = int(DELETE_FAILED)
|
|
|
|
|
2014-05-26 02:29:22 -04:00
|
|
|
new_config['ANIDB'] = {}
|
2014-07-27 06:59:21 -04:00
|
|
|
new_config['ANIDB']['use_anidb'] = int(USE_ANIDB)
|
2014-05-26 02:29:22 -04:00
|
|
|
new_config['ANIDB']['anidb_username'] = ANIDB_USERNAME
|
|
|
|
new_config['ANIDB']['anidb_password'] = helpers.encrypt(ANIDB_PASSWORD, ENCRYPTION_VERSION)
|
2014-07-27 06:59:21 -04:00
|
|
|
new_config['ANIDB']['anidb_use_mylist'] = int(ANIDB_USE_MYLIST)
|
2014-05-26 02:29:22 -04:00
|
|
|
|
|
|
|
new_config['ANIME'] = {}
|
|
|
|
new_config['ANIME']['anime_split_home'] = int(ANIME_SPLIT_HOME)
|
|
|
|
|
2014-03-10 01:18:05 -04:00
|
|
|
new_config.write()
|
|
|
|
|
|
|
|
|
|
|
|
def launchBrowser(startPort=None):
|
|
|
|
if not startPort:
|
|
|
|
startPort = WEB_PORT
|
|
|
|
if ENABLE_HTTPS:
|
|
|
|
browserURL = 'https://localhost:%d%s' % (startPort, WEB_ROOT)
|
|
|
|
else:
|
|
|
|
browserURL = 'http://localhost:%d%s' % (startPort, WEB_ROOT)
|
|
|
|
try:
|
|
|
|
webbrowser.open(browserURL, 2, 1)
|
|
|
|
except:
|
|
|
|
try:
|
|
|
|
webbrowser.open(browserURL, 1, 1)
|
|
|
|
except:
|
|
|
|
logger.log(u"Unable to launch a browser", logger.ERROR)
|
|
|
|
|
|
|
|
|
2014-03-25 01:57:24 -04:00
|
|
|
def getEpList(epIDs, showid=None):
|
2014-03-20 14:03:22 -04:00
|
|
|
if epIDs == None or len(epIDs) == 0:
|
2014-03-10 01:18:05 -04:00
|
|
|
return []
|
|
|
|
|
2014-03-25 01:57:24 -04:00
|
|
|
query = "SELECT * FROM tv_episodes WHERE indexerid in (%s)" % (",".join(['?'] * len(epIDs)),)
|
2014-03-10 01:18:05 -04:00
|
|
|
params = epIDs
|
|
|
|
|
2014-03-20 14:03:22 -04:00
|
|
|
if showid != None:
|
2014-03-10 01:18:05 -04:00
|
|
|
query += " AND showid = ?"
|
|
|
|
params.append(showid)
|
|
|
|
|
2014-06-21 18:46:59 -04:00
|
|
|
myDB = db.DBConnection()
|
|
|
|
sqlResults = myDB.select(query, params)
|
2014-03-10 01:18:05 -04:00
|
|
|
|
|
|
|
epList = []
|
|
|
|
|
|
|
|
for curEp in sqlResults:
|
|
|
|
curShowObj = helpers.findCertainShow(showList, int(curEp["showid"]))
|
|
|
|
curEpObj = curShowObj.getEpisode(int(curEp["season"]), int(curEp["episode"]))
|
|
|
|
epList.append(curEpObj)
|
|
|
|
|
2014-07-10 10:15:44 -04:00
|
|
|
return epList
|