def save_config(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['config_version'] = CONFIG_VERSION new_config['General']['log_dir'] = ACTUAL_LOG_DIR if ACTUAL_LOG_DIR else 'Logs' 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'] = WEB_PASSWORD new_config['General']['launch_browser'] = LAUNCH_BROWSER new_config['General']['ff_profile_path'] = FF_PROFILE_PATH new_config['General']['nw_user_name'] = NW_USER_NAME new_config['General']['nw_password'] = NW_PASSWORD new_config['General']['nw_account_name'] = NW_ACCOUNT_NAME new_config['General']['use_twitter'] = USE_TWITTER new_config['General']['twitter_username'] = TWITTER_USERNAME new_config['General']['twitter_password'] = TWITTER_PASSWORD new_config['General']['twitter_prefix'] = TWITTER_PREFIX new_config['General']['twitter_notify_on_levelup'] = TWITTER_NOTIFY_ON_LEVELUP new_config['General']['twitter_notify_on_raretask'] = TWITTER_NOTIFY_ON_RARETASK new_config['General']['blackout_en'] = BLACKOUT_EN new_config['General']['blackout_start_hour'] = BLACKOUT_START_HOUR new_config['General']['blackout_end_hour'] = BLACKOUT_END_HOUR new_config.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIGFILE new_config['General'] = {} new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_user'] = HTTP_USER new_config['General']['http_pass'] = HTTP_PASS new_config['General']['http_root'] = HTTP_ROOT new_config['General']['http_look'] = HTTP_LOOK new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['logdir'] = LOGDIR new_config['General']['imp_onlyisbn'] = int(IMP_ONLYISBN) new_config['General']['imp_preflang'] = IMP_PREFLANG new_config['General']['imp_autoadd'] = IMP_AUTOADD new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_port'] = SAB_PORT new_config['SABnzbd']['sab_subdir'] = SAB_SUBDIR new_config['SABnzbd']['sab_user'] = SAB_USER new_config['SABnzbd']['sab_pass'] = SAB_PASS new_config['SABnzbd']['sab_api'] = SAB_API new_config['SABnzbd']['sab_cat'] = SAB_CAT new_config['General']['destination_dir'] = DESTINATION_DIR new_config['General']['destination_copy'] = int(DESTINATION_COPY) new_config['General']['download_dir'] = DOWNLOAD_DIR new_config['General']['blackhole'] = int(BLACKHOLE) new_config['General']['blackholedir'] = BLACKHOLEDIR new_config['General']['usenet_retention'] = USENET_RETENTION new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_user'] = NZBMATRIX_USER new_config['NZBMatrix']['nzbmatrix_api'] = NZBMATRIX_API new_config['Newznab'] = {} new_config['Newznab']['newznab'] = int(NEWZNAB) new_config['Newznab']['newznab_host'] = NEWZNAB_HOST new_config['Newznab']['newznab_api'] = NEWZNAB_API new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_uid'] = NEWZBIN_UID new_config['Newzbin']['newzbin_pass'] = NEWZBIN_PASS new_config['UsenetCrawler'] = {} new_config['UsenetCrawler']['usenetcrawler'] = int(USENETCRAWLER) new_config['UsenetCrawler']['usenetcrawler_host'] = USENETCRAWLER_HOST new_config['UsenetCrawler']['usenetcrawler_api'] = USENETCRAWLER_API new_config.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_username'] = HTTP_USERNAME new_config['General']['http_password'] = HTTP_PASSWORD new_config['General']['http_root'] = HTTP_ROOT new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['git_path'] = GIT_PATH new_config['General']['music_dir'] = MUSIC_DIR new_config['General']['prefer_lossless'] = int(PREFER_LOSSLESS) new_config['General']['flac_to_mp3'] = int(FLAC_TO_MP3) new_config['General']['move_files'] = int(MOVE_FILES) new_config['General']['rename_files'] = int(RENAME_FILES) new_config['General']['folder_format'] = FOLDER_FORMAT new_config['General']['file_format'] = FILE_FORMAT new_config['General']['cleanup_files'] = int(CLEANUP_FILES) new_config['General']['add_album_art'] = int(ADD_ALBUM_ART) new_config['General']['download_dir'] = DOWNLOAD_DIR new_config['General']['blackhole'] = int(BLACKHOLE) new_config['General']['blackhole_dir'] = BLACKHOLE_DIR new_config['General']['usenet_retention'] = USENET_RETENTION new_config['General']['nzb_search_interval'] = NZB_SEARCH_INTERVAL new_config['General']['libraryscan_interval'] = LIBRARYSCAN_INTERVAL new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_username'] = SAB_USERNAME new_config['SABnzbd']['sab_password'] = SAB_PASSWORD new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY new_config['SABnzbd']['sab_category'] = SAB_CATEGORY new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_username'] = NZBMATRIX_USERNAME new_config['NZBMatrix']['nzbmatrix_apikey'] = NZBMATRIX_APIKEY new_config['Newznab'] = {} new_config['Newznab']['newznab'] = int(NEWZNAB) new_config['Newznab']['newznab_host'] = NEWZNAB_HOST new_config['Newznab']['newznab_apikey'] = NEWZNAB_APIKEY new_config['NZBsorg'] = {} new_config['NZBsorg']['nzbsorg'] = int(NZBSORG) new_config['NZBsorg']['nzbsorg_uid'] = NZBSORG_UID new_config['NZBsorg']['nzbsorg_hash'] = NZBSORG_HASH new_config.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_username'] = HTTP_USER new_config['General']['http_password'] = HTTP_PASS new_config['General']['http_root'] = HTTP_ROOT new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIGFILE new_config['General'] = {} new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_user'] = HTTP_USER new_config['General']['http_pass'] = HTTP_PASS new_config['General']['http_root'] = HTTP_ROOT new_config['General']['http_look'] = HTTP_LOOK new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['logdir'] = LOGDIR new_config['General']['imp_onlyisbn'] = int(IMP_ONLYISBN) new_config['General']['imp_preflang'] = IMP_PREFLANG new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_port'] = SAB_PORT new_config['SABnzbd']['sab_user'] = SAB_USER new_config['SABnzbd']['sab_pass'] = SAB_PASS new_config['SABnzbd']['sab_api'] = SAB_API new_config['SABnzbd']['sab_cat'] = SAB_CAT new_config['SABnzbd']['sab_dir'] = SAB_DIR new_config['SABnzbd']['blackhole'] = int(BLACKHOLE) new_config['SABnzbd']['blackholedir'] = BLACKHOLEDIR new_config['SABnzbd']['usenet_retention'] = USENET_RETENTION new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_user'] = NZBMATRIX_USER new_config['NZBMatrix']['nzbmatrix_api'] = NZBMATRIX_API new_config['Newznab'] = {} new_config['Newznab']['newznab'] = int(NEWZNAB) new_config['Newznab']['newznab_host'] = NEWZNAB_HOST new_config['Newznab']['newznab_api'] = NEWZNAB_API new_config['NZBsorg'] = {} new_config['NZBsorg']['nzbsorg'] = int(NZBSORG) new_config['NZBsorg']['nzbsorg_uid'] = NZBSORG_UID new_config['NZBsorg']['nzbsorg_hash'] = NZBSORG_HASH new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_uid'] = NEWZBIN_UID new_config['Newzbin']['newzbin_pass'] = NEWZBIN_PASS new_config.write()
def Write(self): new_config = ConfigObj() new_config.filename = core.CONFIG_FILE new_config['General'] = {} new_config['General']['http_port'] = core.HTTP_PORT new_config['General']['http_host'] = core.HTTP_HOST new_config['General']['http_username'] = core.HTTP_USERNAME new_config['General']['http_password'] = core.HTTP_PASSWORD new_config['Syssetting'] = {} new_config['Syssetting']['web_interface'] = core.WEB_INTERFACE new_config['Syssetting']['rooms'] = core.ROOMS new_config['Syssetting']['debug_log'] = core.DEBUG_LOG new_config['Syssetting']['root'] = core.HTTP_ROOT new_config.write()
def save_config(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['log_dir'] = LOG_DIR new_config['General']['web_port'] = WEB_PORT 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'] = WEB_PASSWORD new_config['General']['enable_https'] = int(ENABLE_HTTPS) new_config['General']['https_cert'] = HTTPS_CERT new_config['General']['https_key'] = HTTPS_KEY new_config['General']['git_path'] = GIT_PATH new_config.write()
def save_config(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['psql'] = psql new_config['General']['accesslog'] = accesslog new_config['General']['moviedir'] = moviedir new_config['General']['seriesdir'] = seriesdir new_config['General']['try_guessing'] = int(try_guessing) new_config['General']['delete_logs'] = int(delete_logs) new_config['General']['scrobble_series'] = int(scrobble_series) new_config['General']['use_database'] = int(use_database) new_config['General']['scrobble_movies'] = int(scrobble_movies) new_config['General']['clean_uncomplete_only'] = int(clean_uncomplete_only) new_config['Advanced'] = {} new_config['Advanced']['logtoconsole'] = int(logtoconsole) new_config['Advanced']['debugmode'] = int(debugmode) new_config['Advanced']['min_progress'] = min_progress new_config['Advanced']['interval'] = interval new_config['Trakt'] = {} new_config['Trakt']['trakt_pass'] = trakt_pass new_config['Trakt']['trakt_user'] = trakt_user #new_config['Trakt']['trakt_key'] = trakt_key new_config['Boxcar'] = {} new_config['Boxcar']['use_boxcar'] = int(use_boxcar) new_config['Boxcar']['boxcar_username'] = boxcar_username new_config['Postprocessing'] = {} new_config['Postprocessing']['move_watched_movies'] = int(move_watched_movies) new_config['Postprocessing']['move_watched_series'] = int(move_watched_series) new_config['Postprocessing']['move_movies_to_dir'] = move_movies_to_dir new_config['Postprocessing']['move_series_to_dir'] = move_series_to_dir new_config['Postprocessing']['update_synoindex'] = int(update_synoindex) new_config['Postprocessing']['delete_from_index'] = int(delete_from_index) new_config.write()
def saveConfig(self): """ This will write out the configuration file to the system. It will be called when the application is done with everything else to ensure any settings that are updated while running are preserved for the next run. Also the user could go and modify this file between runs if they so desired. """ configFile = ConfigObj() configFile.filename = self.config #General stuff configFile['GENERAL'] = {} configFile['GENERAL']['log_dir'] = self.log_dir configFile['GENERAL']['data_dir'] = self.data_dir #User Specific configFile['USER_SETTINGS'] = {} configFile['USER_SETTINGS']['picture_root'] = self.picture_root configFile['SCHEDULING'] = {} configFile['SCHEDULING']['start_time'] = self.start_time configFile['SCHEDULING']['scan_interval'] = self.scan_interval configFile.write()
def config_write(): logger.info('Writing Config') new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_username'] = HTTP_USERNAME new_config['General']['http_password'] = HTTP_PASSWORD new_config['General']['site_username'] = USERNAME new_config['General']['site_password'] = PASSWORD new_config['General']['dldir'] = ROOTDIR new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['makecbz'] = int(CBZ_Compress) #Write Config new_config.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIGFILE new_config['General'] = {} new_config['General']['server_name'] = SERVER_NAME new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_user'] = HTTP_USER new_config['General']['http_pass'] = HTTP_PASS new_config['General']['http_root'] = HTTP_ROOT new_config['General']['http_look'] = HTTP_LOOK new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['logdir'] = LOGDIR new_config['XBMC'] = {} new_config['XBMC']['xbmc_version'] = XBMC_VERSION new_config['XBMC']['xbmc_host'] = XBMC_HOST new_config['XBMC']['xbmc_port'] = XBMC_PORT new_config['XBMC']['xbmc_user'] = XBMC_USER new_config['XBMC']['xbmc_password'] = XBMC_PASSWORD new_config['XBMC']['xbmc_thumb_path'] = XBMC_THUMB_PATH new_config.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config["General"] = {} new_config["General"]["config_version"] = CONFIG_VERSION new_config["General"]["http_port"] = HTTP_PORT new_config["General"]["http_host"] = HTTP_HOST new_config["General"]["http_username"] = HTTP_USERNAME new_config["General"]["http_password"] = HTTP_PASSWORD new_config["General"]["http_root"] = HTTP_ROOT new_config["General"]["http_proxy"] = int(HTTP_PROXY) new_config["General"]["launch_browser"] = int(LAUNCH_BROWSER) new_config["General"]["api_enabled"] = int(API_ENABLED) new_config["General"]["api_key"] = API_KEY new_config["General"]["log_dir"] = LOG_DIR new_config["General"]["git_path"] = GIT_PATH new_config["General"]["check_github"] = int(CHECK_GITHUB) new_config["General"]["check_github_on_startup"] = int(CHECK_GITHUB_ON_STARTUP) new_config["General"]["check_github_interval"] = CHECK_GITHUB_INTERVAL new_config["General"]["music_dir"] = MUSIC_DIR new_config["General"]["destination_dir"] = DESTINATION_DIR new_config["General"]["lossless_destination_dir"] = LOSSLESS_DESTINATION_DIR new_config["General"]["preferred_quality"] = PREFERRED_QUALITY new_config["General"]["preferred_bitrate"] = PREFERRED_BITRATE new_config["General"]["preferred_bitrate_high_buffer"] = PREFERRED_BITRATE_HIGH_BUFFER new_config["General"]["preferred_bitrate_low_buffer"] = PREFERRED_BITRATE_LOW_BUFFER new_config["General"]["detect_bitrate"] = int(DETECT_BITRATE) new_config["General"]["auto_add_artists"] = int(ADD_ARTISTS) new_config["General"]["correct_metadata"] = int(CORRECT_METADATA) new_config["General"]["move_files"] = int(MOVE_FILES) new_config["General"]["rename_files"] = int(RENAME_FILES) new_config["General"]["folder_format"] = FOLDER_FORMAT new_config["General"]["file_format"] = FILE_FORMAT new_config["General"]["cleanup_files"] = int(CLEANUP_FILES) new_config["General"]["add_album_art"] = int(ADD_ALBUM_ART) new_config["General"]["embed_album_art"] = int(EMBED_ALBUM_ART) new_config["General"]["embed_lyrics"] = int(EMBED_LYRICS) new_config["General"]["download_dir"] = DOWNLOAD_DIR new_config["General"]["blackhole"] = int(BLACKHOLE) new_config["General"]["blackhole_dir"] = BLACKHOLE_DIR new_config["General"]["usenet_retention"] = USENET_RETENTION new_config["General"]["include_extras"] = int(INCLUDE_EXTRAS) new_config["General"]["extras"] = EXTRAS new_config["General"]["autowant_upcoming"] = int(AUTOWANT_UPCOMING) new_config["General"]["autowant_all"] = int(AUTOWANT_ALL) new_config["General"]["numberofseeders"] = NUMBEROFSEEDERS new_config["General"]["torrentblackhole_dir"] = TORRENTBLACKHOLE_DIR new_config["General"]["isohunt"] = int(ISOHUNT) new_config["General"]["kat"] = int(KAT) new_config["General"]["mininova"] = int(MININOVA) new_config["General"]["download_torrent_dir"] = DOWNLOAD_TORRENT_DIR new_config["Waffles"] = {} new_config["Waffles"]["waffles"] = int(WAFFLES) new_config["Waffles"]["waffles_uid"] = WAFFLES_UID new_config["Waffles"]["waffles_passkey"] = WAFFLES_PASSKEY new_config["What.cd"] = {} new_config["What.cd"]["whatcd"] = int(WHATCD) new_config["What.cd"]["whatcd_username"] = WHATCD_USERNAME new_config["What.cd"]["whatcd_password"] = WHATCD_PASSWORD new_config["General"]["search_interval"] = SEARCH_INTERVAL new_config["General"]["libraryscan_interval"] = LIBRARYSCAN_INTERVAL new_config["General"]["download_scan_interval"] = DOWNLOAD_SCAN_INTERVAL new_config["SABnzbd"] = {} new_config["SABnzbd"]["sab_host"] = SAB_HOST new_config["SABnzbd"]["sab_username"] = SAB_USERNAME new_config["SABnzbd"]["sab_password"] = SAB_PASSWORD new_config["SABnzbd"]["sab_apikey"] = SAB_APIKEY new_config["SABnzbd"]["sab_category"] = SAB_CATEGORY new_config["NZBMatrix"] = {} new_config["NZBMatrix"]["nzbmatrix"] = int(NZBMATRIX) new_config["NZBMatrix"]["nzbmatrix_username"] = NZBMATRIX_USERNAME new_config["NZBMatrix"]["nzbmatrix_apikey"] = NZBMATRIX_APIKEY new_config["Newznab"] = {} new_config["Newznab"]["newznab"] = int(NEWZNAB) new_config["Newznab"]["newznab_host"] = NEWZNAB_HOST new_config["Newznab"]["newznab_apikey"] = NEWZNAB_APIKEY new_config["Newznab"]["newznab_enabled"] = int(NEWZNAB_ENABLED) # Need to unpack the extra newznabs for saving in config.ini flattened_newznabs = [] for newznab in EXTRA_NEWZNABS: for item in newznab: flattened_newznabs.append(item) new_config["Newznab"]["extra_newznabs"] = flattened_newznabs new_config["NZBsorg"] = {} new_config["NZBsorg"]["nzbsorg"] = int(NZBSORG) new_config["NZBsorg"]["nzbsorg_uid"] = NZBSORG_UID new_config["NZBsorg"]["nzbsorg_hash"] = NZBSORG_HASH new_config["Newzbin"] = {} new_config["Newzbin"]["newzbin"] = int(NEWZBIN) new_config["Newzbin"]["newzbin_uid"] = NEWZBIN_UID new_config["Newzbin"]["newzbin_password"] = NEWZBIN_PASSWORD new_config["Prowl"] = {} new_config["Prowl"]["prowl_enabled"] = int(PROWL_ENABLED) new_config["Prowl"]["prowl_keys"] = PROWL_KEYS new_config["Prowl"]["prowl_onsnatch"] = int(PROWL_ONSNATCH) new_config["Prowl"]["prowl_priority"] = int(PROWL_PRIORITY) new_config["XBMC"] = {} new_config["XBMC"]["xbmc_enabled"] = int(XBMC_ENABLED) new_config["XBMC"]["xbmc_host"] = XBMC_HOST new_config["XBMC"]["xbmc_username"] = XBMC_USERNAME new_config["XBMC"]["xbmc_password"] = XBMC_PASSWORD new_config["XBMC"]["xbmc_update"] = int(XBMC_UPDATE) new_config["XBMC"]["xbmc_notify"] = int(XBMC_NOTIFY) new_config["NMA"] = {} new_config["NMA"]["nma_enabled"] = int(NMA_ENABLED) new_config["NMA"]["nma_apikey"] = NMA_APIKEY new_config["NMA"]["nma_priority"] = NMA_PRIORITY new_config["NMA"]["nma_onsnatch"] = int(PROWL_ONSNATCH) new_config["Synoindex"] = {} new_config["Synoindex"]["synoindex_enabled"] = int(SYNOINDEX_ENABLED) new_config["General"]["lastfm_username"] = LASTFM_USERNAME new_config["General"]["interface"] = INTERFACE new_config["General"]["folder_permissions"] = FOLDER_PERMISSIONS new_config["General"]["music_encoder"] = int(MUSIC_ENCODER) new_config["General"]["encoder"] = ENCODER new_config["General"]["bitrate"] = int(BITRATE) new_config["General"]["samplingfrequency"] = int(SAMPLINGFREQUENCY) new_config["General"]["encoderfolder"] = ENCODERFOLDER new_config["General"]["advancedencoder"] = ADVANCEDENCODER new_config["General"]["encoderoutputformat"] = ENCODEROUTPUTFORMAT new_config["General"]["encoderquality"] = ENCODERQUALITY new_config["General"]["encodervbrcbr"] = ENCODERVBRCBR new_config["General"]["encoderlossless"] = int(ENCODERLOSSLESS) new_config["General"]["delete_lossless_files"] = int(DELETE_LOSSLESS_FILES) new_config["General"]["mirror"] = MIRROR new_config["General"]["customhost"] = CUSTOMHOST new_config["General"]["customport"] = CUSTOMPORT new_config["General"]["customsleep"] = CUSTOMSLEEP new_config["General"]["hpuser"] = HPUSER new_config["General"]["hppass"] = HPPASS new_config["Advanced"] = {} new_config["Advanced"]["album_completion_pct"] = ALBUM_COMPLETION_PCT new_config["Advanced"]["cache_sizemb"] = CACHE_SIZEMB new_config.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['config_version'] = CONFIG_VERSION new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_username'] = HTTP_USERNAME new_config['General']['http_password'] = HTTP_PASSWORD new_config['General']['http_root'] = HTTP_ROOT new_config['General']['http_proxy'] = int(HTTP_PROXY) new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['api_enabled'] = int(API_ENABLED) new_config['General']['api_key'] = API_KEY new_config['General']['log_dir'] = LOG_DIR new_config['General']['git_path'] = GIT_PATH new_config['General']['check_github'] = int(CHECK_GITHUB) new_config['General']['check_github_on_startup'] = int(CHECK_GITHUB_ON_STARTUP) new_config['General']['check_github_interval'] = CHECK_GITHUB_INTERVAL new_config['General']['music_dir'] = MUSIC_DIR new_config['General']['destination_dir'] = DESTINATION_DIR new_config['General']['lossless_destination_dir'] = LOSSLESS_DESTINATION_DIR new_config['General']['preferred_quality'] = PREFERRED_QUALITY new_config['General']['preferred_bitrate'] = PREFERRED_BITRATE new_config['General']['preferred_bitrate_high_buffer'] = PREFERRED_BITRATE_HIGH_BUFFER new_config['General']['preferred_bitrate_low_buffer'] = PREFERRED_BITRATE_LOW_BUFFER new_config['General']['detect_bitrate'] = int(DETECT_BITRATE) new_config['General']['auto_add_artists'] = int(ADD_ARTISTS) new_config['General']['correct_metadata'] = int(CORRECT_METADATA) new_config['General']['move_files'] = int(MOVE_FILES) new_config['General']['rename_files'] = int(RENAME_FILES) new_config['General']['folder_format'] = FOLDER_FORMAT new_config['General']['file_format'] = FILE_FORMAT new_config['General']['cleanup_files'] = int(CLEANUP_FILES) new_config['General']['add_album_art'] = int(ADD_ALBUM_ART) new_config['General']['embed_album_art'] = int(EMBED_ALBUM_ART) new_config['General']['embed_lyrics'] = int(EMBED_LYRICS) new_config['General']['download_dir'] = DOWNLOAD_DIR new_config['General']['blackhole'] = int(BLACKHOLE) new_config['General']['blackhole_dir'] = BLACKHOLE_DIR new_config['General']['usenet_retention'] = USENET_RETENTION new_config['General']['include_extras'] = int(INCLUDE_EXTRAS) new_config['General']['extras'] = EXTRAS new_config['General']['autowant_upcoming'] = int(AUTOWANT_UPCOMING) new_config['General']['autowant_all'] = int(AUTOWANT_ALL) new_config['General']['numberofseeders'] = NUMBEROFSEEDERS new_config['General']['torrentblackhole_dir'] = TORRENTBLACKHOLE_DIR new_config['General']['isohunt'] = int(ISOHUNT) new_config['General']['kat'] = int(KAT) new_config['General']['mininova'] = int(MININOVA) new_config['General']['download_torrent_dir'] = DOWNLOAD_TORRENT_DIR new_config['Waffles'] = {} new_config['Waffles']['waffles'] = int(WAFFLES) new_config['Waffles']['waffles_uid'] = WAFFLES_UID new_config['Waffles']['waffles_passkey'] = WAFFLES_PASSKEY new_config['General']['search_interval'] = SEARCH_INTERVAL new_config['General']['libraryscan_interval'] = LIBRARYSCAN_INTERVAL new_config['General']['download_scan_interval'] = DOWNLOAD_SCAN_INTERVAL new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_username'] = SAB_USERNAME new_config['SABnzbd']['sab_password'] = SAB_PASSWORD new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY new_config['SABnzbd']['sab_category'] = SAB_CATEGORY new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_username'] = NZBMATRIX_USERNAME new_config['NZBMatrix']['nzbmatrix_apikey'] = NZBMATRIX_APIKEY new_config['Newznab'] = {} new_config['Newznab']['newznab'] = int(NEWZNAB) new_config['Newznab']['newznab_host'] = NEWZNAB_HOST new_config['Newznab']['newznab_apikey'] = NEWZNAB_APIKEY new_config['Newznab']['newznab_enabled'] = int(NEWZNAB_ENABLED) # Need to unpack the extra newznabs for saving in config.ini flattened_newznabs = [] for newznab in EXTRA_NEWZNABS: for item in newznab: flattened_newznabs.append(item) new_config['Newznab']['extra_newznabs'] = flattened_newznabs new_config['NZBsorg'] = {} new_config['NZBsorg']['nzbsorg'] = int(NZBSORG) new_config['NZBsorg']['nzbsorg_uid'] = NZBSORG_UID new_config['NZBsorg']['nzbsorg_hash'] = NZBSORG_HASH new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_uid'] = NEWZBIN_UID new_config['Newzbin']['newzbin_password'] = NEWZBIN_PASSWORD new_config['Prowl'] = {} new_config['Prowl']['prowl_enabled'] = int(PROWL_ENABLED) new_config['Prowl']['prowl_keys'] = PROWL_KEYS new_config['Prowl']['prowl_onsnatch'] = int(PROWL_ONSNATCH) new_config['Prowl']['prowl_priority'] = int(PROWL_PRIORITY) new_config['XBMC'] = {} new_config['XBMC']['xbmc_enabled'] = int(XBMC_ENABLED) new_config['XBMC']['xbmc_host'] = XBMC_HOST new_config['XBMC']['xbmc_username'] = XBMC_USERNAME new_config['XBMC']['xbmc_password'] = XBMC_PASSWORD new_config['XBMC']['xbmc_update'] = int(XBMC_UPDATE) new_config['XBMC']['xbmc_notify'] = int(XBMC_NOTIFY) new_config['NMA'] = {} new_config['NMA']['nma_enabled'] = int(NMA_ENABLED) new_config['NMA']['nma_apikey'] = NMA_APIKEY new_config['NMA']['nma_priority'] = NMA_PRIORITY new_config['Synoindex'] = {} new_config['Synoindex']['synoindex_enabled'] = int(SYNOINDEX_ENABLED) new_config['General']['lastfm_username'] = LASTFM_USERNAME new_config['General']['interface'] = INTERFACE new_config['General']['folder_permissions'] = FOLDER_PERMISSIONS new_config['General']['music_encoder'] = int(MUSIC_ENCODER) new_config['General']['encoder'] = ENCODER new_config['General']['bitrate'] = int(BITRATE) new_config['General']['samplingfrequency'] = int(SAMPLINGFREQUENCY) new_config['General']['encoderfolder'] = ENCODERFOLDER new_config['General']['advancedencoder'] = ADVANCEDENCODER new_config['General']['encoderoutputformat'] = ENCODEROUTPUTFORMAT new_config['General']['encoderquality'] = ENCODERQUALITY new_config['General']['encodervbrcbr'] = ENCODERVBRCBR new_config['General']['encoderlossless'] = int(ENCODERLOSSLESS) new_config['General']['delete_lossless_files'] = int(DELETE_LOSSLESS_FILES) new_config['General']['mirror'] = MIRROR new_config['General']['customhost'] = CUSTOMHOST new_config['General']['customport'] = CUSTOMPORT new_config['General']['customsleep'] = CUSTOMSLEEP new_config['General']['hpuser'] = HPUSER new_config['General']['hppass'] = HPPASS new_config['Advanced'] = {} new_config['Advanced']['album_completion_pct'] = ALBUM_COMPLETION_PCT new_config.write()
defaultconfig['EZRSS']['ezrss'] = '1' defaultconfig['PUBLICHD'] = {} defaultconfig['PUBLICHD']['publichd'] = '1' defaultconfig['KAT'] = {} defaultconfig['KAT']['kat'] = '1' defaultconfig['THEPIRATEBAY'] = {} defaultconfig['THEPIRATEBAY']['thepiratebay'] = '1' defaultconfig['Womble'] = {} defaultconfig['Womble']['womble'] = '0' defaultconfig['XBMC']['xbmc_notify_ondownload'] = '1' defaultconfig['XBMC']['xbmc_notify_onsnatch'] = '1' defaultconfig['XBMC']['xbmc_update_library'] = '1' defaultconfig['XBMC']['xbmc_update_full'] = '1' sickbeardconfig.merge(defaultconfig) sickbeardconfig.write() # launch SickBeard # ---------------- if sickbeard_launch: xbmc.log('SickPotatoHead: Launching SickBeard...', level=xbmc.LOGDEBUG) subprocess.call(sickbeard, close_fds=True) xbmc.log('SickPotatoHead: ...done', level=xbmc.LOGDEBUG) except Exception, e: xbmc.log('SickPotatoHead: SickBeard exception occurred', level=xbmc.LOGERROR) xbmc.log(str(e), level=xbmc.LOGERROR) # SickBeard end # CouchPotatoServer start
def config_write(): new_config = ConfigObj() new_config.filename = CONFIGFILE new_config['General'] = {} new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_user'] = HTTP_USER new_config['General']['http_pass'] = HTTP_PASS new_config['General']['http_root'] = HTTP_ROOT new_config['General']['http_look'] = HTTP_LOOK new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['proxy_host'] = PROXY_HOST new_config['General']['proxy_type'] = PROXY_TYPE new_config['General']['logdir'] = LOGDIR new_config['General']['loglevel'] = int(LOGLEVEL) new_config['General']['match_ratio'] = MATCH_RATIO new_config['General']['imp_onlyisbn'] = int(IMP_ONLYISBN) new_config['General']['imp_preflang'] = IMP_PREFLANG new_config['General']['imp_autoadd'] = IMP_AUTOADD new_config['General']['ebook_type'] = EBOOK_TYPE new_config['Git'] = {} new_config['Git']['git_user'] = GIT_USER new_config['Git']['git_repo'] = GIT_REPO new_config['Git']['git_branch'] = GIT_BRANCH new_config['Git']['install_type'] = INSTALL_TYPE new_config['Git']['current_version'] = CURRENT_VERSION new_config['Git']['latest_version'] = LATEST_VERSION new_config['Git']['commits_behind'] = COMMITS_BEHIND new_config['USENET'] = {} new_config['USENET']['nzb_downloader_sabnzbd'] = NZB_DOWNLOADER_SABNZBD new_config['USENET']['nzb_downloader_blackhole'] = NZB_DOWNLOADER_BLACKHOLE new_config['USENET']['nzb_blackholedir'] = NZB_BLACKHOLEDIR new_config['USENET']['usenet_retention'] = USENET_RETENTION new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_port'] = SAB_PORT new_config['SABnzbd']['sab_subdir'] = SAB_SUBDIR new_config['SABnzbd']['sab_user'] = SAB_USER new_config['SABnzbd']['sab_pass'] = SAB_PASS new_config['SABnzbd']['sab_api'] = SAB_API new_config['SABnzbd']['sab_cat'] = SAB_CAT new_config['General']['destination_dir'] = DESTINATION_DIR new_config['General']['destination_copy'] = int(DESTINATION_COPY) new_config['General']['download_dir'] = DOWNLOAD_DIR new_config['DLMethod'] = {} new_config['DLMethod']['use_tor'] = int(USE_TOR) new_config['DLMethod']['use_nzb'] = int(USE_NZB) new_config['API'] = {} new_config['API']['book_api'] = BOOK_API new_config['API']['gr_api'] = GR_API new_config['API']['gb_api'] = GB_API new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_user'] = NZBMATRIX_USER new_config['NZBMatrix']['nzbmatrix_api'] = NZBMATRIX_API new_config['Newznab'] = {} new_config['Newznab']['newznab'] = int(NEWZNAB) new_config['Newznab']['newznab_host'] = NEWZNAB_HOST new_config['Newznab']['newznab_api'] = NEWZNAB_API new_config['Newznab2'] = {} new_config['Newznab2']['newznab2'] = int(NEWZNAB2) new_config['Newznab2']['newznab_host2'] = NEWZNAB_HOST2 new_config['Newznab2']['newznab_api2'] = NEWZNAB_API2 new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_uid'] = NEWZBIN_UID new_config['Newzbin']['newzbin_pass'] = NEWZBIN_PASS new_config['TORRENT'] = {} new_config['TORRENT'][ 'tor_downloader_blackhole'] = TOR_DOWNLOADER_BLACKHOLE new_config['TORRENT']['tor_downloader_utorrent'] = TOR_DOWNLOADER_UTORRENT new_config['TORRENT']['numberofseeders'] = NUMBEROFSEEDERS new_config['TORRENT']['torrent_dir'] = TORRENT_DIR new_config['UTORRENT'] = {} new_config['UTORRENT']['utorrent_host'] = UTORRENT_HOST new_config['UTORRENT']['utorrent_user'] = UTORRENT_USER new_config['UTORRENT']['utorrent_pass'] = UTORRENT_PASS new_config['UTORRENT']['utorrent_label'] = UTORRENT_LABEL new_config['KAT'] = {} new_config['KAT']['kat'] = int(KAT) new_config['UsenetCrawler'] = {} new_config['UsenetCrawler']['usenetcrawler'] = int(USENETCRAWLER) new_config['UsenetCrawler']['usenetcrawler_host'] = USENETCRAWLER_HOST new_config['UsenetCrawler']['usenetcrawler_api'] = USENETCRAWLER_API new_config['SearchScan'] = {} new_config['SearchScan']['search_interval'] = SEARCH_INTERVAL new_config['SearchScan']['scan_interval'] = SCAN_INTERVAL new_config['SearchScan']['versioncheck_interval'] = VERSIONCHECK_INTERVAL new_config['LibraryScan'] = {} new_config['LibraryScan']['full_scan'] = FULL_SCAN new_config['LibraryScan']['notfound_status'] = NOTFOUND_STATUS new_config['LibraryScan']['add_author'] = ADD_AUTHOR new_config['PostProcess'] = {} new_config['PostProcess']['ebook_dest_folder'] = EBOOK_DEST_FOLDER new_config['PostProcess']['ebook_dest_file'] = EBOOK_DEST_FILE new_config['PostProcess']['mag_dest_folder'] = MAG_DEST_FOLDER new_config['PostProcess']['mag_dest_file'] = MAG_DEST_FILE 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_username'] = TWITTER_USERNAME new_config['Twitter']['twitter_password'] = TWITTER_PASSWORD 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_token'] = BOXCAR_TOKEN 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_token'] = PUSHBULLET_TOKEN new_config['Pushbullet']['pushbullet_deviceid'] = PUSHBULLET_DEVICEID new_config['NMA'] = {} new_config['NMA']['nma_enabled'] = int(NMA_ENABLED) new_config['NMA']['nma_apikey'] = NMA_APIKEY new_config['NMA']['nma_priority'] = NMA_PRIORITY new_config['NMA']['nma_onsnatch'] = int(NMA_ONSNATCH) new_config.write()
def save_config(): new_config = ConfigObj() new_config.filename = sickbeard.CONFIG_FILE new_config['General'] = {} new_config['General']['log_dir'] = LOG_DIR new_config['General']['web_port'] = WEB_PORT new_config['General']['web_host'] = WEB_HOST new_config['General']['web_ipv6'] = 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'] = WEB_PASSWORD new_config['General']['nzb_method'] = NZB_METHOD new_config['General']['usenet_retention'] = int(USENET_RETENTION) new_config['General']['search_frequency'] = int(SEARCH_FREQUENCY) new_config['General']['backlog_search_frequency'] = int(BACKLOG_SEARCH_FREQUENCY) new_config['General']['use_nzb'] = int(USE_NZB) new_config['General']['download_propers'] = int(DOWNLOAD_PROPERS) new_config['General']['quality_default'] = int(QUALITY_DEFAULT) new_config['General']['season_folders_format'] = SEASON_FOLDERS_FORMAT new_config['General']['season_folders_default'] = int(SEASON_FOLDERS_DEFAULT) new_config['General']['provider_order'] = ' '.join([x.getID() for x in providers.sortedProviderList()]) new_config['General']['version_notify'] = int(VERSION_NOTIFY) new_config['General']['naming_ep_name'] = int(NAMING_EP_NAME) new_config['General']['naming_show_name'] = int(NAMING_SHOW_NAME) new_config['General']['naming_ep_type'] = int(NAMING_EP_TYPE) new_config['General']['naming_multi_ep_type'] = int(NAMING_MULTI_EP_TYPE) new_config['General']['naming_sep_type'] = int(NAMING_SEP_TYPE) new_config['General']['naming_use_periods'] = int(NAMING_USE_PERIODS) new_config['General']['naming_quality'] = int(NAMING_QUALITY) new_config['General']['naming_dates'] = int(NAMING_DATES) new_config['General']['use_torrent'] = int(USE_TORRENT) new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['metadata_type'] = METADATA_TYPE new_config['General']['metadata_show'] = int(METADATA_SHOW) new_config['General']['metadata_episode'] = int(METADATA_EPISODE) new_config['General']['art_poster'] = int(ART_POSTER) new_config['General']['art_fanart'] = int(ART_FANART) new_config['General']['art_thumbnails'] = int(ART_THUMBNAILS) new_config['General']['art_season_thumbnails'] = int(ART_SEASON_THUMBNAILS) new_config['General']['cache_dir'] = CACHE_DIR new_config['General']['tv_download_dir'] = TV_DOWNLOAD_DIR new_config['General']['keep_processed_dir'] = int(KEEP_PROCESSED_DIR) new_config['General']['process_automatically'] = int(PROCESS_AUTOMATICALLY) new_config['General']['rename_episodes'] = int(RENAME_EPISODES) new_config['General']['extra_scripts'] = '|'.join(EXTRA_SCRIPTS) new_config['General']['git_path'] = GIT_PATH new_config['Blackhole'] = {} new_config['Blackhole']['nzb_dir'] = NZB_DIR new_config['Blackhole']['torrent_dir'] = TORRENT_DIR new_config['TVBinz'] = {} new_config['TVBinz']['tvbinz'] = int(TVBINZ) new_config['TVBinz']['tvbinz_uid'] = TVBINZ_UID new_config['TVBinz']['tvbinz_hash'] = TVBINZ_HASH new_config['TVBinz']['tvbinz_auth'] = TVBINZ_AUTH 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['NZBsRUS'] = {} new_config['NZBsRUS']['nzbsrus'] = int(NZBSRUS) new_config['NZBsRUS']['nzbsrus_uid'] = NZBSRUS_UID new_config['NZBsRUS']['nzbsrus_hash'] = NZBSRUS_HASH new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_username'] = NZBMATRIX_USERNAME new_config['NZBMatrix']['nzbmatrix_apikey'] = NZBMATRIX_APIKEY new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_username'] = NEWZBIN_USERNAME new_config['Newzbin']['newzbin_password'] = NEWZBIN_PASSWORD new_config['Bin-Req'] = {} new_config['Bin-Req']['binreq'] = int(BINREQ) new_config['Womble'] = {} new_config['Womble']['womble'] = int(WOMBLE) new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_username'] = SAB_USERNAME new_config['SABnzbd']['sab_password'] = SAB_PASSWORD new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY new_config['SABnzbd']['sab_category'] = SAB_CATEGORY new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['XBMC'] = {} new_config['XBMC']['xbmc_notify_onsnatch'] = int(XBMC_NOTIFY_ONSNATCH) new_config['XBMC']['xbmc_notify_ondownload'] = int(XBMC_NOTIFY_ONDOWNLOAD) new_config['XBMC']['xbmc_update_library'] = int(XBMC_UPDATE_LIBRARY) new_config['XBMC']['xbmc_update_full'] = int(XBMC_UPDATE_FULL) new_config['XBMC']['xbmc_host'] = XBMC_HOST new_config['XBMC']['xbmc_username'] = XBMC_USERNAME new_config['XBMC']['xbmc_password'] = XBMC_PASSWORD new_config['Growl'] = {} new_config['Growl']['use_growl'] = int(USE_GROWL) new_config['Growl']['growl_host'] = GROWL_HOST new_config['Growl']['growl_password'] = GROWL_PASSWORD new_config['Twitter'] = {} new_config['Twitter']['use_twitter'] = int(USE_TWITTER) new_config['Twitter']['twitter_username'] = TWITTER_USERNAME new_config['Twitter']['twitter_password'] = TWITTER_PASSWORD new_config['Twitter']['twitter_prefix'] = TWITTER_PREFIX new_config['Jabber'] = {} new_config['Jabber']['use_jabber'] = int(USE_JABBER) new_config['Jabber']['jabber_username'] = JABBER_USERNAME new_config['Jabber']['jabber_password'] = JABBER_PASSWORD new_config['Jabber']['jabber_server'] = JABBER_SERVER new_config['Jabber']['jabber_port'] = JABBER_PORT new_config['Jabber']['jabber_recipient'] = JABBER_RECIPIENT new_config['Newznab'] = {} new_config['Newznab']['newznab_data'] = '!!!'.join([x.configStr() for x in newznabProviderList]) new_config.write()
def config_write(): logger.debug(u'Opening config file: %s' % CONFIGFILE) new_config = ConfigObj() new_config.filename = CONFIGFILE logger.debug(u'Writing settings.') new_config['General'] = {} new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_user'] = HTTP_USER new_config['General']['http_pass'] = HTTP_PASS new_config['General']['http_root'] = HTTP_ROOT new_config['General']['http_look'] = HTTP_LOOK new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['logdir'] = LOGDIR new_config['General']['git_path'] = GIT_PATH new_config['General']['git_user'] = GIT_USER new_config['General']['git_project'] = GIT_PROJECT new_config['General']['git_branch'] = GIT_BRANCH new_config['General']['check_update'] = int(CHECK_UPDATE) new_config['General']['check_update_interval'] = CHECK_UPDATE_INTERVAL new_config['General']['imp_onlyisbn'] = int(IMP_ONLYISBN) new_config['General']['imp_preflang'] = IMP_PREFLANG new_config['General']['ebook_type'] = EBOOK_TYPE new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_port'] = SAB_PORT new_config['SABnzbd']['sab_user'] = SAB_USER new_config['SABnzbd']['sab_pass'] = SAB_PASS new_config['SABnzbd']['sab_api'] = SAB_API new_config['SABnzbd']['sab_cat'] = SAB_CAT new_config['General']['destination_dir'] = DESTINATION_DIR new_config['General']['destination_copy'] = int(DESTINATION_COPY) new_config['General']['download_dir'] = DOWNLOAD_DIR new_config['General']['blackhole'] = int(BLACKHOLE) new_config['General']['blackholedir'] = BLACKHOLEDIR new_config['General']['usenet_retention'] = USENET_RETENTION new_config['General']['gr_api'] = GR_API new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_user'] = NZBMATRIX_USER new_config['NZBMatrix']['nzbmatrix_api'] = NZBMATRIX_API new_config['Newznab'] = {} new_config['Newznab']['newznab'] = int(NEWZNAB) new_config['Newznab']['newznab_host'] = NEWZNAB_HOST new_config['Newznab']['newznab_api'] = NEWZNAB_API new_config['Newznab2'] = {} new_config['Newznab2']['newznab2'] = int(NEWZNAB2) new_config['Newznab2']['newznab_host2'] = NEWZNAB_HOST2 new_config['Newznab2']['newznab_api2'] = NEWZNAB_API2 new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_uid'] = NEWZBIN_UID new_config['Newzbin']['newzbin_pass'] = NEWZBIN_PASS logger.debug(u'Closing file.') new_config.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_username'] = HTTP_USERNAME new_config['General']['http_password'] = HTTP_PASSWORD new_config['General']['http_root'] = HTTP_ROOT new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['log_dir'] = LOG_DIR new_config['General']['git_path'] = GIT_PATH new_config['General']['music_dir'] = MUSIC_DIR new_config['General']['destination_dir'] = DESTINATION_DIR new_config['General']['preferred_quality'] = PREFERRED_QUALITY new_config['General']['preferred_bitrate'] = PREFERRED_BITRATE new_config['General']['detect_bitrate'] = int(DETECT_BITRATE) new_config['General']['correct_metadata'] = int(CORRECT_METADATA) new_config['General']['move_files'] = int(MOVE_FILES) new_config['General']['rename_files'] = int(RENAME_FILES) new_config['General']['folder_format'] = FOLDER_FORMAT new_config['General']['file_format'] = FILE_FORMAT new_config['General']['cleanup_files'] = int(CLEANUP_FILES) new_config['General']['add_album_art'] = int(ADD_ALBUM_ART) new_config['General']['embed_album_art'] = int(EMBED_ALBUM_ART) new_config['General']['download_dir'] = DOWNLOAD_DIR new_config['General']['blackhole'] = int(BLACKHOLE) new_config['General']['blackhole_dir'] = BLACKHOLE_DIR new_config['General']['usenet_retention'] = USENET_RETENTION new_config['General']['include_extras'] = int(INCLUDE_EXTRAS) new_config['General']['nzb_search_interval'] = NZB_SEARCH_INTERVAL new_config['General']['libraryscan_interval'] = LIBRARYSCAN_INTERVAL new_config['General']['download_scan_interval'] = DOWNLOAD_SCAN_INTERVAL new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_username'] = SAB_USERNAME new_config['SABnzbd']['sab_password'] = SAB_PASSWORD new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY new_config['SABnzbd']['sab_category'] = SAB_CATEGORY new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_username'] = NZBMATRIX_USERNAME new_config['NZBMatrix']['nzbmatrix_apikey'] = NZBMATRIX_APIKEY new_config['Newznab'] = {} new_config['Newznab']['newznab'] = int(NEWZNAB) new_config['Newznab']['newznab_host'] = NEWZNAB_HOST new_config['Newznab']['newznab_apikey'] = NEWZNAB_APIKEY new_config['NZBsorg'] = {} new_config['NZBsorg']['nzbsorg'] = int(NZBSORG) new_config['NZBsorg']['nzbsorg_uid'] = NZBSORG_UID new_config['NZBsorg']['nzbsorg_hash'] = NZBSORG_HASH new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_uid'] = NEWZBIN_UID new_config['Newzbin']['newzbin_password'] = NEWZBIN_PASSWORD new_config['General']['lastfm_username'] = LASTFM_USERNAME new_config['General']['interface'] = INTERFACE new_config.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['config_version'] = CONFIG_VERSION new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_username'] = HTTP_USERNAME new_config['General']['http_password'] = HTTP_PASSWORD new_config['General']['http_root'] = HTTP_ROOT new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['api_enabled'] = int(API_ENABLED) new_config['General']['api_key'] = API_KEY new_config['General']['log_dir'] = LOG_DIR new_config['General']['git_path'] = GIT_PATH new_config['General']['check_github'] = int(CHECK_GITHUB) new_config['General']['check_github_on_startup'] = int( CHECK_GITHUB_ON_STARTUP) new_config['General']['check_github_interval'] = CHECK_GITHUB_INTERVAL new_config['General']['music_dir'] = MUSIC_DIR new_config['General']['destination_dir'] = DESTINATION_DIR new_config['General']['preferred_quality'] = PREFERRED_QUALITY new_config['General']['preferred_bitrate'] = PREFERRED_BITRATE new_config['General']['detect_bitrate'] = int(DETECT_BITRATE) new_config['General']['auto_add_artists'] = int(ADD_ARTISTS) new_config['General']['correct_metadata'] = int(CORRECT_METADATA) new_config['General']['move_files'] = int(MOVE_FILES) new_config['General']['rename_files'] = int(RENAME_FILES) new_config['General']['folder_format'] = FOLDER_FORMAT new_config['General']['file_format'] = FILE_FORMAT new_config['General']['cleanup_files'] = int(CLEANUP_FILES) new_config['General']['add_album_art'] = int(ADD_ALBUM_ART) new_config['General']['embed_album_art'] = int(EMBED_ALBUM_ART) new_config['General']['embed_lyrics'] = int(EMBED_LYRICS) new_config['General']['download_dir'] = DOWNLOAD_DIR new_config['General']['blackhole'] = int(BLACKHOLE) new_config['General']['blackhole_dir'] = BLACKHOLE_DIR new_config['General']['usenet_retention'] = USENET_RETENTION new_config['General']['include_extras'] = int(INCLUDE_EXTRAS) new_config['General']['autowant_upcoming'] = int(AUTOWANT_UPCOMING) new_config['General']['autowant_all'] = int(AUTOWANT_ALL) new_config['General']['numberofseeders'] = NUMBEROFSEEDERS new_config['General']['torrentblackhole_dir'] = TORRENTBLACKHOLE_DIR new_config['General']['isohunt'] = int(ISOHUNT) new_config['General']['kat'] = int(KAT) new_config['General']['mininova'] = int(MININOVA) new_config['General']['download_torrent_dir'] = DOWNLOAD_TORRENT_DIR new_config['General']['search_interval'] = SEARCH_INTERVAL new_config['General']['libraryscan_interval'] = LIBRARYSCAN_INTERVAL new_config['General']['download_scan_interval'] = DOWNLOAD_SCAN_INTERVAL new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_username'] = SAB_USERNAME new_config['SABnzbd']['sab_password'] = SAB_PASSWORD new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY new_config['SABnzbd']['sab_category'] = SAB_CATEGORY new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_username'] = NZBMATRIX_USERNAME new_config['NZBMatrix']['nzbmatrix_apikey'] = NZBMATRIX_APIKEY new_config['Newznab'] = {} new_config['Newznab']['newznab'] = int(NEWZNAB) new_config['Newznab']['newznab_host'] = NEWZNAB_HOST new_config['Newznab']['newznab_apikey'] = NEWZNAB_APIKEY new_config['NZBsorg'] = {} new_config['NZBsorg']['nzbsorg'] = int(NZBSORG) new_config['NZBsorg']['nzbsorg_uid'] = NZBSORG_UID new_config['NZBsorg']['nzbsorg_hash'] = NZBSORG_HASH new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_uid'] = NEWZBIN_UID new_config['Newzbin']['newzbin_password'] = NEWZBIN_PASSWORD new_config['Prowl'] = {} new_config['Prowl']['prowl_enabled'] = int(PROWL_ENABLED) new_config['Prowl']['prowl_keys'] = PROWL_KEYS new_config['Prowl']['prowl_onsnatch'] = int(PROWL_ONSNATCH) new_config['Prowl']['prowl_priority'] = int(PROWL_PRIORITY) new_config['XBMC'] = {} new_config['XBMC']['xbmc_enabled'] = int(XBMC_ENABLED) new_config['XBMC']['xbmc_host'] = XBMC_HOST new_config['XBMC']['xbmc_username'] = XBMC_USERNAME new_config['XBMC']['xbmc_password'] = XBMC_PASSWORD new_config['XBMC']['xbmc_update'] = int(XBMC_UPDATE) new_config['XBMC']['xbmc_notify'] = int(XBMC_NOTIFY) new_config['NMA'] = {} new_config['NMA']['nma_enabled'] = int(NMA_ENABLED) new_config['NMA']['nma_apikey'] = NMA_APIKEY new_config['NMA']['nma_priority'] = NMA_PRIORITY new_config['General']['lastfm_username'] = LASTFM_USERNAME new_config['General']['interface'] = INTERFACE new_config['General']['folder_permissions'] = FOLDER_PERMISSIONS new_config['General']['music_encoder'] = int(MUSIC_ENCODER) new_config['General']['encoder'] = ENCODER new_config['General']['bitrate'] = int(BITRATE) new_config['General']['samplingfrequency'] = int(SAMPLINGFREQUENCY) new_config['General']['encoderfolder'] = ENCODERFOLDER new_config['General']['advancedencoder'] = ADVANCEDENCODER new_config['General']['encoderoutputformat'] = ENCODEROUTPUTFORMAT new_config['General']['encoderquality'] = ENCODERQUALITY new_config['General']['encodervbrcbr'] = ENCODERVBRCBR new_config['General']['encoderlossless'] = ENCODERLOSSLESS new_config['General']['mirror'] = MIRROR new_config['General']['customhost'] = CUSTOMHOST new_config['General']['customport'] = CUSTOMPORT new_config['General']['customsleep'] = CUSTOMSLEEP new_config['General']['hpuser'] = HPUSER new_config['General']['hppass'] = HPPASS new_config.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config["General"] = {} new_config["General"]["http_port"] = HTTP_PORT new_config["General"]["http_host"] = HTTP_HOST new_config["General"]["http_username"] = HTTP_USERNAME new_config["General"]["http_password"] = HTTP_PASSWORD new_config["General"]["http_root"] = HTTP_ROOT new_config["General"]["launch_browser"] = int(LAUNCH_BROWSER) new_config["General"]["log_dir"] = LOG_DIR new_config["General"]["git_path"] = GIT_PATH new_config["General"]["music_dir"] = MUSIC_DIR new_config["General"]["destination_dir"] = DESTINATION_DIR new_config["General"]["preferred_quality"] = PREFERRED_QUALITY new_config["General"]["preferred_bitrate"] = PREFERRED_BITRATE new_config["General"]["detect_bitrate"] = int(DETECT_BITRATE) new_config["General"]["auto_add_artists"] = int(ADD_ARTISTS) new_config["General"]["correct_metadata"] = int(CORRECT_METADATA) new_config["General"]["move_files"] = int(MOVE_FILES) new_config["General"]["rename_files"] = int(RENAME_FILES) new_config["General"]["folder_format"] = FOLDER_FORMAT new_config["General"]["file_format"] = FILE_FORMAT new_config["General"]["cleanup_files"] = int(CLEANUP_FILES) new_config["General"]["add_album_art"] = int(ADD_ALBUM_ART) new_config["General"]["embed_album_art"] = int(EMBED_ALBUM_ART) new_config["General"]["embed_lyrics"] = int(EMBED_LYRICS) new_config["General"]["download_dir"] = DOWNLOAD_DIR new_config["General"]["blackhole"] = int(BLACKHOLE) new_config["General"]["blackhole_dir"] = BLACKHOLE_DIR new_config["General"]["usenet_retention"] = USENET_RETENTION new_config["General"]["include_extras"] = int(INCLUDE_EXTRAS) new_config["General"]["nzb_search_interval"] = NZB_SEARCH_INTERVAL new_config["General"]["libraryscan_interval"] = LIBRARYSCAN_INTERVAL new_config["General"]["download_scan_interval"] = DOWNLOAD_SCAN_INTERVAL new_config["SABnzbd"] = {} new_config["SABnzbd"]["sab_host"] = SAB_HOST new_config["SABnzbd"]["sab_username"] = SAB_USERNAME new_config["SABnzbd"]["sab_password"] = SAB_PASSWORD new_config["SABnzbd"]["sab_apikey"] = SAB_APIKEY new_config["SABnzbd"]["sab_category"] = SAB_CATEGORY new_config["NZBMatrix"] = {} new_config["NZBMatrix"]["nzbmatrix"] = int(NZBMATRIX) new_config["NZBMatrix"]["nzbmatrix_username"] = NZBMATRIX_USERNAME new_config["NZBMatrix"]["nzbmatrix_apikey"] = NZBMATRIX_APIKEY new_config["Newznab"] = {} new_config["Newznab"]["newznab"] = int(NEWZNAB) new_config["Newznab"]["newznab_host"] = NEWZNAB_HOST new_config["Newznab"]["newznab_apikey"] = NEWZNAB_APIKEY new_config["NZBsorg"] = {} new_config["NZBsorg"]["nzbsorg"] = int(NZBSORG) new_config["NZBsorg"]["nzbsorg_uid"] = NZBSORG_UID new_config["NZBsorg"]["nzbsorg_hash"] = NZBSORG_HASH new_config["Newzbin"] = {} new_config["Newzbin"]["newzbin"] = int(NEWZBIN) new_config["Newzbin"]["newzbin_uid"] = NEWZBIN_UID new_config["Newzbin"]["newzbin_password"] = NEWZBIN_PASSWORD new_config["General"]["lastfm_username"] = LASTFM_USERNAME new_config["General"]["interface"] = INTERFACE new_config["General"]["folder_permissions"] = FOLDER_PERMISSIONS new_config["General"]["encode"] = int(ENCODE) new_config["General"]["encoder"] = ENCODER new_config["General"]["bitrate"] = int(BITRATE) new_config["General"]["samplingfrequency"] = int(SAMPLINGFREQUENCY) new_config["General"]["encoderfolder"] = ENCODERFOLDER new_config["General"]["advancedencoder"] = ADVANCEDENCODER new_config["General"]["encoderoutputformat"] = ENCODEROUTPUTFORMAT new_config["General"]["encoderquality"] = ENCODERQUALITY new_config["General"]["encodervbrcbr"] = ENCODERVBRCBR new_config.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_username'] = HTTP_USERNAME new_config['General']['http_password'] = HTTP_PASSWORD new_config['General']['http_root'] = HTTP_ROOT new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['log_dir'] = LOG_DIR new_config['General']['git_path'] = GIT_PATH new_config['General']['music_dir'] = MUSIC_DIR new_config['General']['destination_dir'] = DESTINATION_DIR new_config['General']['preferred_quality'] = PREFERRED_QUALITY new_config['General']['preferred_bitrate'] = PREFERRED_BITRATE new_config['General']['detect_bitrate'] = int(DETECT_BITRATE) new_config['General']['auto_add_artists'] = int(ADD_ARTISTS) new_config['General']['correct_metadata'] = int(CORRECT_METADATA) new_config['General']['move_files'] = int(MOVE_FILES) new_config['General']['rename_files'] = int(RENAME_FILES) new_config['General']['folder_format'] = FOLDER_FORMAT new_config['General']['file_format'] = FILE_FORMAT new_config['General']['cleanup_files'] = int(CLEANUP_FILES) new_config['General']['add_album_art'] = int(ADD_ALBUM_ART) new_config['General']['embed_album_art'] = int(EMBED_ALBUM_ART) new_config['General']['embed_lyrics'] = int(EMBED_LYRICS) new_config['General']['download_dir'] = DOWNLOAD_DIR new_config['General']['blackhole'] = int(BLACKHOLE) new_config['General']['blackhole_dir'] = BLACKHOLE_DIR new_config['General']['usenet_retention'] = USENET_RETENTION new_config['General']['include_extras'] = int(INCLUDE_EXTRAS) new_config['General']['numberofseeders'] = NUMBEROFSEEDERS new_config['General']['torrentblackhole_dir'] = TORRENTBLACKHOLE_DIR new_config['General']['isohunt'] = int(ISOHUNT) new_config['General']['kat'] = int(KAT) new_config['General']['mininova'] = int(MININOVA) new_config['General']['download_torrent_dir'] = DOWNLOAD_TORRENT_DIR new_config['General']['search_interval'] = SEARCH_INTERVAL new_config['General']['libraryscan_interval'] = LIBRARYSCAN_INTERVAL new_config['General']['download_scan_interval'] = DOWNLOAD_SCAN_INTERVAL new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_username'] = SAB_USERNAME new_config['SABnzbd']['sab_password'] = SAB_PASSWORD new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY new_config['SABnzbd']['sab_category'] = SAB_CATEGORY new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_username'] = NZBMATRIX_USERNAME new_config['NZBMatrix']['nzbmatrix_apikey'] = NZBMATRIX_APIKEY new_config['Newznab'] = {} new_config['Newznab']['newznab'] = int(NEWZNAB) new_config['Newznab']['newznab_host'] = NEWZNAB_HOST new_config['Newznab']['newznab_apikey'] = NEWZNAB_APIKEY new_config['NZBsorg'] = {} new_config['NZBsorg']['nzbsorg'] = int(NZBSORG) new_config['NZBsorg']['nzbsorg_uid'] = NZBSORG_UID new_config['NZBsorg']['nzbsorg_hash'] = NZBSORG_HASH new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_uid'] = NEWZBIN_UID new_config['Newzbin']['newzbin_password'] = NEWZBIN_PASSWORD new_config['Prowl'] = {} new_config['Prowl']['prowl_enabled'] = int(PROWL_ENABLED) new_config['Prowl']['prowl_keys'] = PROWL_KEYS new_config['Prowl']['prowl_onsnatch'] = int(PROWL_ONSNATCH) new_config['Prowl']['prowl_priority'] = int(PROWL_PRIORITY) new_config['General']['lastfm_username'] = LASTFM_USERNAME new_config['General']['interface'] = INTERFACE new_config['General']['folder_permissions'] = FOLDER_PERMISSIONS new_config['General']['encode'] = int(ENCODE) new_config['General']['encoder'] = ENCODER new_config['General']['bitrate'] = int(BITRATE) new_config['General']['samplingfrequency'] = int(SAMPLINGFREQUENCY) new_config['General']['encoderfolder'] = ENCODERFOLDER new_config['General']['advancedencoder'] = ADVANCEDENCODER new_config['General']['encoderoutputformat'] = ENCODEROUTPUTFORMAT new_config['General']['encoderquality'] = ENCODERQUALITY new_config['General']['encodervbrcbr'] = ENCODERVBRCBR new_config['General']['encoderlossless'] = ENCODERLOSSLESS new_config['General']['mirror'] = MIRROR new_config['General']['customhost'] = CUSTOMHOST new_config['General']['customport'] = CUSTOMPORT new_config['General']['customsleep'] = CUSTOMSLEEP new_config['General']['hpuser'] = HPUSER new_config['General']['hppass'] = HPPASS new_config.write()
categories['tv']['name'] = 'tv' categories['tv']['script'] = 'sabToSickBeard.py' categories['tv']['priority'] = '-100' categories['movies'] = {} categories['movies']['name'] = 'movies' categories['movies']['dir'] = 'movies' categories['movies']['priority'] = '-100' categories['music'] = {} categories['music']['name'] = 'music' categories['music']['dir'] = 'music' categories['music']['priority'] = '-100' defaultConfig['servers'] = servers defaultConfig['categories'] = categories sabNzbdConfig.merge(defaultConfig) sabNzbdConfig.write() # also keep the autoProcessTV config up to date autoProcessConfig = ConfigObj(xbmc.translatePath(pSabNzbdScripts + '/autoProcessTV.cfg'), create_empty=True) defaultConfig = ConfigObj() defaultConfig['SickBeard'] = {} defaultConfig['SickBeard']['host'] = 'localhost' defaultConfig['SickBeard']['port'] = '8082' defaultConfig['SickBeard']['username'] = user defaultConfig['SickBeard']['password'] = pwd autoProcessConfig.merge(defaultConfig) autoProcessConfig.write() # launch SABnzbd and get the API key
def save_config(): new_config = ConfigObj() new_config.filename = sickbeard.CONFIG_FILE new_config["General"] = {} new_config["General"]["log_dir"] = LOG_DIR new_config["General"]["web_port"] = WEB_PORT new_config["General"]["web_host"] = WEB_HOST new_config["General"]["web_ipv6"] = 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"] = WEB_PASSWORD new_config["General"]["nzb_method"] = NZB_METHOD new_config["General"]["usenet_retention"] = int(USENET_RETENTION) new_config["General"]["search_frequency"] = int(SEARCH_FREQUENCY) new_config["General"]["backlog_search_frequency"] = int(BACKLOG_SEARCH_FREQUENCY) new_config["General"]["use_nzb"] = int(USE_NZB) new_config["General"]["download_propers"] = int(DOWNLOAD_PROPERS) new_config["General"]["quality_default"] = int(QUALITY_DEFAULT) new_config["General"]["season_folders_format"] = SEASON_FOLDERS_FORMAT new_config["General"]["season_folders_default"] = int(SEASON_FOLDERS_DEFAULT) new_config["General"]["provider_order"] = " ".join([x.getID() for x in providers.sortedProviderList()]) new_config["General"]["version_notify"] = int(VERSION_NOTIFY) new_config["General"]["naming_ep_name"] = int(NAMING_EP_NAME) new_config["General"]["naming_show_name"] = int(NAMING_SHOW_NAME) new_config["General"]["naming_ep_type"] = int(NAMING_EP_TYPE) new_config["General"]["naming_multi_ep_type"] = int(NAMING_MULTI_EP_TYPE) new_config["General"]["naming_sep_type"] = int(NAMING_SEP_TYPE) new_config["General"]["naming_use_periods"] = int(NAMING_USE_PERIODS) new_config["General"]["naming_quality"] = int(NAMING_QUALITY) new_config["General"]["naming_dates"] = int(NAMING_DATES) new_config["General"]["use_torrent"] = int(USE_TORRENT) new_config["General"]["launch_browser"] = int(LAUNCH_BROWSER) new_config["General"]["metadata_type"] = METADATA_TYPE new_config["General"]["metadata_show"] = int(METADATA_SHOW) new_config["General"]["metadata_episode"] = int(METADATA_EPISODE) new_config["General"]["art_poster"] = int(ART_POSTER) new_config["General"]["art_fanart"] = int(ART_FANART) new_config["General"]["art_thumbnails"] = int(ART_THUMBNAILS) new_config["General"]["art_season_thumbnails"] = int(ART_SEASON_THUMBNAILS) new_config["General"]["cache_dir"] = CACHE_DIR if CACHE_DIR else "cache" new_config["General"]["tv_download_dir"] = TV_DOWNLOAD_DIR new_config["General"]["keep_processed_dir"] = int(KEEP_PROCESSED_DIR) new_config["General"]["process_automatically"] = int(PROCESS_AUTOMATICALLY) new_config["General"]["rename_episodes"] = int(RENAME_EPISODES) new_config["General"]["extra_scripts"] = "|".join(EXTRA_SCRIPTS) new_config["General"]["git_path"] = GIT_PATH new_config["Blackhole"] = {} new_config["Blackhole"]["nzb_dir"] = NZB_DIR new_config["Blackhole"]["torrent_dir"] = TORRENT_DIR new_config["TVBinz"] = {} new_config["TVBinz"]["tvbinz"] = int(TVBINZ) new_config["TVBinz"]["tvbinz_uid"] = TVBINZ_UID new_config["TVBinz"]["tvbinz_hash"] = TVBINZ_HASH new_config["TVBinz"]["tvbinz_auth"] = TVBINZ_AUTH 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["NZBsRUS"] = {} new_config["NZBsRUS"]["nzbsrus"] = int(NZBSRUS) new_config["NZBsRUS"]["nzbsrus_uid"] = NZBSRUS_UID new_config["NZBsRUS"]["nzbsrus_hash"] = NZBSRUS_HASH new_config["NZBMatrix"] = {} new_config["NZBMatrix"]["nzbmatrix"] = int(NZBMATRIX) new_config["NZBMatrix"]["nzbmatrix_username"] = NZBMATRIX_USERNAME new_config["NZBMatrix"]["nzbmatrix_apikey"] = NZBMATRIX_APIKEY new_config["Newzbin"] = {} new_config["Newzbin"]["newzbin"] = int(NEWZBIN) new_config["Newzbin"]["newzbin_username"] = NEWZBIN_USERNAME new_config["Newzbin"]["newzbin_password"] = NEWZBIN_PASSWORD new_config["Bin-Req"] = {} new_config["Bin-Req"]["binreq"] = int(BINREQ) new_config["Womble"] = {} new_config["Womble"]["womble"] = int(WOMBLE) new_config["SABnzbd"] = {} new_config["SABnzbd"]["sab_username"] = SAB_USERNAME new_config["SABnzbd"]["sab_password"] = SAB_PASSWORD new_config["SABnzbd"]["sab_apikey"] = SAB_APIKEY new_config["SABnzbd"]["sab_category"] = SAB_CATEGORY new_config["SABnzbd"]["sab_host"] = SAB_HOST new_config["XBMC"] = {} new_config["XBMC"]["xbmc_notify_onsnatch"] = int(XBMC_NOTIFY_ONSNATCH) new_config["XBMC"]["xbmc_notify_ondownload"] = int(XBMC_NOTIFY_ONDOWNLOAD) new_config["XBMC"]["xbmc_update_library"] = int(XBMC_UPDATE_LIBRARY) new_config["XBMC"]["xbmc_update_full"] = int(XBMC_UPDATE_FULL) new_config["XBMC"]["xbmc_host"] = XBMC_HOST new_config["XBMC"]["xbmc_username"] = XBMC_USERNAME new_config["XBMC"]["xbmc_password"] = XBMC_PASSWORD new_config["Growl"] = {} new_config["Growl"]["use_growl"] = int(USE_GROWL) new_config["Growl"]["growl_host"] = GROWL_HOST new_config["Growl"]["growl_password"] = GROWL_PASSWORD new_config["Twitter"] = {} new_config["Twitter"]["use_twitter"] = int(USE_TWITTER) new_config["Twitter"]["twitter_username"] = TWITTER_USERNAME new_config["Twitter"]["twitter_password"] = TWITTER_PASSWORD new_config["Twitter"]["twitter_prefix"] = TWITTER_PREFIX new_config["Newznab"] = {} new_config["Newznab"]["newznab_data"] = "!!!".join([x.configStr() for x in newznabProviderList]) new_config.write()
def save_config(): new_config = ConfigObj() new_config.filename = sickbeard.CONFIG_FILE new_config['General'] = {} new_config['General']['log_dir'] = LOG_DIR new_config['General']['web_port'] = WEB_PORT new_config['General']['web_host'] = WEB_HOST new_config['General']['web_ipv6'] = 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'] = WEB_PASSWORD new_config['General']['nzb_method'] = NZB_METHOD new_config['General']['usenet_retention'] = int(USENET_RETENTION) new_config['General']['search_frequency'] = int(SEARCH_FREQUENCY) new_config['General']['download_propers'] = int(DOWNLOAD_PROPERS) new_config['General']['quality_default'] = int(QUALITY_DEFAULT) new_config['General']['season_folders_format'] = SEASON_FOLDERS_FORMAT new_config['General']['season_folders_default'] = int(SEASON_FOLDERS_DEFAULT) new_config['General']['provider_order'] = ' '.join([x.getID() for x in providers.sortedProviderList()]) new_config['General']['version_notify'] = int(VERSION_NOTIFY) new_config['General']['naming_ep_name'] = int(NAMING_EP_NAME) new_config['General']['naming_show_name'] = int(NAMING_SHOW_NAME) new_config['General']['naming_ep_type'] = int(NAMING_EP_TYPE) new_config['General']['naming_multi_ep_type'] = int(NAMING_MULTI_EP_TYPE) new_config['General']['naming_sep_type'] = int(NAMING_SEP_TYPE) new_config['General']['naming_use_periods'] = int(NAMING_USE_PERIODS) new_config['General']['naming_quality'] = int(NAMING_QUALITY) new_config['General']['naming_dates'] = int(NAMING_DATES) new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['use_banner'] = int(USE_BANNER) new_config['General']['use_listview'] = int(USE_LISTVIEW) new_config['General']['metadata_xbmc'] = metadata_provider_dict['XBMC'].get_config() new_config['General']['metadata_mediabrowser'] = metadata_provider_dict['MediaBrowser'].get_config() new_config['General']['metadata_ps3'] = metadata_provider_dict['Sony PS3'].get_config() new_config['General']['cache_dir'] = CACHE_DIR if CACHE_DIR else 'cache' new_config['General']['tv_download_dir'] = TV_DOWNLOAD_DIR new_config['General']['keep_processed_dir'] = int(KEEP_PROCESSED_DIR) new_config['General']['move_associated_files'] = int(MOVE_ASSOCIATED_FILES) new_config['General']['process_automatically'] = int(PROCESS_AUTOMATICALLY) new_config['General']['rename_episodes'] = int(RENAME_EPISODES) new_config['General']['extra_scripts'] = '|'.join(EXTRA_SCRIPTS) new_config['General']['git_path'] = GIT_PATH new_config['Blackhole'] = {} new_config['Blackhole']['nzb_dir'] = NZB_DIR new_config['Blackhole']['torrent_dir'] = TORRENT_DIR new_config['EZRSS'] = {} new_config['EZRSS']['ezrss'] = int(EZRSS) new_config['TVBinz'] = {} new_config['TVBinz']['tvbinz'] = int(TVBINZ) new_config['TVBinz']['tvbinz_uid'] = TVBINZ_UID new_config['TVBinz']['tvbinz_hash'] = TVBINZ_HASH new_config['TVBinz']['tvbinz_auth'] = TVBINZ_AUTH 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['NZBsRUS'] = {} new_config['NZBsRUS']['nzbsrus'] = int(NZBSRUS) new_config['NZBsRUS']['nzbsrus_uid'] = NZBSRUS_UID new_config['NZBsRUS']['nzbsrus_hash'] = NZBSRUS_HASH new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_username'] = NZBMATRIX_USERNAME new_config['NZBMatrix']['nzbmatrix_apikey'] = NZBMATRIX_APIKEY new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_username'] = NEWZBIN_USERNAME new_config['Newzbin']['newzbin_password'] = NEWZBIN_PASSWORD new_config['Bin-Req'] = {} new_config['Bin-Req']['binreq'] = int(BINREQ) new_config['Womble'] = {} new_config['Womble']['womble'] = int(WOMBLE) new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_username'] = SAB_USERNAME new_config['SABnzbd']['sab_password'] = SAB_PASSWORD new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY new_config['SABnzbd']['sab_category'] = SAB_CATEGORY new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['XBMC'] = {} new_config['XBMC']['use_xbmc'] = int(USE_XBMC) new_config['XBMC']['xbmc_notify_onsnatch'] = int(XBMC_NOTIFY_ONSNATCH) new_config['XBMC']['xbmc_notify_ondownload'] = int(XBMC_NOTIFY_ONDOWNLOAD) new_config['XBMC']['xbmc_update_library'] = int(XBMC_UPDATE_LIBRARY) new_config['XBMC']['xbmc_update_full'] = int(XBMC_UPDATE_FULL) new_config['XBMC']['xbmc_host'] = XBMC_HOST new_config['XBMC']['xbmc_username'] = XBMC_USERNAME new_config['XBMC']['xbmc_password'] = XBMC_PASSWORD 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_host'] = GROWL_HOST new_config['Growl']['growl_password'] = GROWL_PASSWORD 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_username'] = TWITTER_USERNAME new_config['Twitter']['twitter_password'] = TWITTER_PASSWORD new_config['Twitter']['twitter_prefix'] = TWITTER_PREFIX new_config['Newznab'] = {} new_config['Newznab']['newznab_data'] = '!!!'.join([x.configStr() for x in newznabProviderList]) new_config['GUI'] = {} 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.write()
defaultConfig['EZRSS']['ezrss'] = '1' defaultConfig['PUBLICHD'] = {} defaultConfig['PUBLICHD']['publichd'] = '1' defaultConfig['KAT'] = {} defaultConfig['KAT']['kat'] = '1' defaultConfig['THEPIRATEBAY'] = {} defaultConfig['THEPIRATEBAY']['thepiratebay'] = '1' defaultConfig['Womble'] = {} defaultConfig['Womble']['womble'] = '0' defaultConfig['XBMC']['xbmc_notify_ondownload'] = '1' defaultConfig['XBMC']['xbmc_notify_onsnatch'] = '1' defaultConfig['XBMC']['xbmc_update_library'] = '1' defaultConfig['XBMC']['xbmc_update_full'] = '1' sickBeardConfig.merge(defaultConfig) sickBeardConfig.write() # launch SickBeard # ---------------- if sickbeard_launch: xbmc.log('SickPotatoHead: Launching SickBeard...', level=xbmc.LOGDEBUG) subprocess.call(sickBeard, close_fds=True) xbmc.log('SickPotatoHead: ...done', level=xbmc.LOGDEBUG) except Exception, e: xbmc.log('SickPotatoHead: SickBeard exception occurred', level=xbmc.LOGERROR) xbmc.log(str(e), level=xbmc.LOGERROR) # SickBeard end # CouchPotatoServer start try: # empty password hack
def save(self): new_config = ConfigObj() new_config.filename = self.settings_file new_config.encoding = 'UTF8' new_config['settings'] = {} new_config['settings'][ 'check_for_new_version'] = self.check_for_new_version new_config['settings']['rar_exe_path'] = self.rar_exe_path new_config['settings']['unrar_exe_path'] = self.unrar_exe_path new_config['settings']['send_usage_stats'] = self.send_usage_stats new_config.write() new_config['auto'] = {} new_config['auto']['install_id'] = self.install_id new_config['auto'][ 'last_selected_load_data_style'] = self.last_selected_load_data_style new_config['auto'][ 'last_selected_save_data_style'] = self.last_selected_save_data_style new_config['auto']['last_opened_folder'] = self.last_opened_folder new_config['auto'][ 'last_main_window_width'] = self.last_main_window_width new_config['auto'][ 'last_main_window_height'] = self.last_main_window_height new_config['auto']['last_main_window_x'] = self.last_main_window_x new_config['auto']['last_main_window_y'] = self.last_main_window_y new_config['auto']['last_form_side_width'] = self.last_form_side_width new_config['auto']['last_list_side_width'] = self.last_list_side_width new_config['auto'][ 'last_filelist_sorted_column'] = self.last_filelist_sorted_column new_config['auto'][ 'last_filelist_sorted_order'] = self.last_filelist_sorted_order new_config['identifier'] = {} new_config['identifier'][ 'id_length_delta_thresh'] = self.id_length_delta_thresh new_config['identifier'][ 'id_publisher_blacklist'] = self.id_publisher_blacklist new_config['dialogflags'] = {} new_config['dialogflags'][ 'ask_about_cbi_in_rar'] = self.ask_about_cbi_in_rar new_config['dialogflags']['show_disclaimer'] = self.show_disclaimer new_config['dialogflags'][ 'dont_notify_about_this_version'] = self.dont_notify_about_this_version new_config['dialogflags'][ 'ask_about_usage_stats'] = self.ask_about_usage_stats new_config['dialogflags'][ 'show_no_unrar_warning'] = self.show_no_unrar_warning new_config['filenameparser'] = {} new_config['filenameparser']['parse_scan_info'] = self.parse_scan_info new_config['comicvine'] = {} new_config['comicvine'][ 'use_series_start_as_volume'] = self.use_series_start_as_volume new_config['comicvine'][ 'clear_form_before_populating_from_cv'] = self.clear_form_before_populating_from_cv new_config['comicvine']['remove_html_tables'] = self.remove_html_tables new_config['comicvine']['cv_api_key'] = self.cv_api_key new_config['cbl_transform'] = {} new_config['cbl_transform'][ 'assume_lone_credit_is_primary'] = self.assume_lone_credit_is_primary new_config['cbl_transform'][ 'copy_characters_to_tags'] = self.copy_characters_to_tags new_config['cbl_transform'][ 'copy_teams_to_tags'] = self.copy_teams_to_tags new_config['cbl_transform'][ 'copy_locations_to_tags'] = self.copy_locations_to_tags new_config['cbl_transform'][ 'copy_storyarcs_to_tags'] = self.copy_storyarcs_to_tags new_config['cbl_transform'][ 'copy_notes_to_comments'] = self.copy_notes_to_comments new_config['cbl_transform'][ 'copy_weblink_to_comments'] = self.copy_weblink_to_comments new_config['cbl_transform'][ 'apply_cbl_transform_on_cv_import'] = self.apply_cbl_transform_on_cv_import new_config['cbl_transform'][ 'apply_cbl_transform_on_bulk_operation'] = self.apply_cbl_transform_on_bulk_operation new_config['rename'] = {} new_config['rename']['rename_template'] = self.rename_template new_config['rename'][ 'rename_issue_number_padding'] = self.rename_issue_number_padding new_config['rename'][ 'rename_use_smart_string_cleanup'] = self.rename_use_smart_string_cleanup new_config['rename'][ 'rename_extension_based_on_archive'] = self.rename_extension_based_on_archive new_config['autotag'] = {} new_config['autotag'][ 'save_on_low_confidence'] = self.save_on_low_confidence new_config['autotag'][ 'dont_use_year_when_identifying'] = self.dont_use_year_when_identifying new_config['autotag'][ 'assume_1_if_no_issue_num'] = self.assume_1_if_no_issue_num new_config['autotag'][ 'ignore_leading_numbers_in_filename'] = self.ignore_leading_numbers_in_filename new_config['autotag'][ 'remove_archive_after_successful_match'] = self.remove_archive_after_successful_match new_config['autotag'][ 'wait_and_retry_on_rate_limit'] = self.wait_and_retry_on_rate_limit
def config_write(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['config_version'] = CONFIG_VERSION new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_username'] = HTTP_USERNAME new_config['General']['http_password'] = HTTP_PASSWORD new_config['General']['http_root'] = HTTP_ROOT new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['log_dir'] = LOG_DIR new_config['General']['logverbose'] = int(LOGVERBOSE) new_config['General']['git_path'] = GIT_PATH new_config['General']['cache_dir'] = CACHE_DIR new_config['General']['annuals_on'] = int(ANNUALS_ON) new_config['General']['cv_only'] = int(CV_ONLY) new_config['General']['cv_onetimer'] = int(CV_ONETIMER) new_config['General']['cvapifix'] = int(CVAPIFIX) new_config['General']['check_github'] = int(CHECK_GITHUB) new_config['General']['check_github_on_startup'] = int(CHECK_GITHUB_ON_STARTUP) new_config['General']['check_github_interval'] = CHECK_GITHUB_INTERVAL new_config['General']['destination_dir'] = DESTINATION_DIR new_config['General']['chmod_dir'] = CHMOD_DIR new_config['General']['chmod_file'] = CHMOD_FILE new_config['General']['usenet_retention'] = USENET_RETENTION new_config['General']['search_interval'] = SEARCH_INTERVAL new_config['General']['nzb_startup_search'] = int(NZB_STARTUP_SEARCH) new_config['General']['libraryscan'] = int(LIBRARYSCAN) new_config['General']['libraryscan_interval'] = LIBRARYSCAN_INTERVAL new_config['General']['add_comics'] = int(ADD_COMICS) new_config['General']['comic_dir'] = COMIC_DIR new_config['General']['imp_move'] = int(IMP_MOVE) new_config['General']['imp_rename'] = int(IMP_RENAME) new_config['General']['imp_metadata'] = int(IMP_METADATA) new_config['General']['download_scan_interval'] = DOWNLOAD_SCAN_INTERVAL new_config['General']['interface'] = INTERFACE new_config['General']['autowant_all'] = int(AUTOWANT_ALL) new_config['General']['autowant_upcoming'] = int(AUTOWANT_UPCOMING) new_config['General']['preferred_quality'] = int(PREFERRED_QUALITY) new_config['General']['comic_cover_local'] = int(COMIC_COVER_LOCAL) new_config['General']['correct_metadata'] = int(CORRECT_METADATA) new_config['General']['move_files'] = int(MOVE_FILES) new_config['General']['rename_files'] = int(RENAME_FILES) new_config['General']['folder_format'] = FOLDER_FORMAT new_config['General']['file_format'] = FILE_FORMAT new_config['General']['blackhole'] = int(BLACKHOLE) new_config['General']['blackhole_dir'] = BLACKHOLE_DIR new_config['General']['replace_spaces'] = int(REPLACE_SPACES) new_config['General']['replace_char'] = REPLACE_CHAR new_config['General']['zero_level'] = int(ZERO_LEVEL) new_config['General']['zero_level_n'] = ZERO_LEVEL_N new_config['General']['lowercase_filenames'] = int(LOWERCASE_FILENAMES) new_config['General']['syno_fix'] = int(SYNO_FIX) new_config['General']['search_delay'] = SEARCH_DELAY new_config['General']['grabbag_dir'] = GRABBAG_DIR new_config['General']['highcount'] = HIGHCOUNT new_config['General']['read2filename'] = int(READ2FILENAME) new_config['General']['storyarcdir'] = int(STORYARCDIR) new_config['General']['use_minsize'] = int(USE_MINSIZE) new_config['General']['minsize'] = MINSIZE new_config['General']['use_maxsize'] = int(USE_MAXSIZE) new_config['General']['maxsize'] = MAXSIZE new_config['General']['add_to_csv'] = int(ADD_TO_CSV) new_config['General']['cvinfo'] = int(CVINFO) new_config['General']['log_level'] = LOG_LEVEL new_config['General']['enable_extra_scripts'] = int(ENABLE_EXTRA_SCRIPTS) new_config['General']['extra_scripts'] = EXTRA_SCRIPTS new_config['General']['enable_pre_scripts'] = int(ENABLE_PRE_SCRIPTS) new_config['General']['pre_scripts'] = PRE_SCRIPTS new_config['General']['post_processing'] = int(POST_PROCESSING) new_config['General']['weekfolder'] = int(WEEKFOLDER) new_config['General']['locmove'] = int(LOCMOVE) new_config['General']['newcom_dir'] = NEWCOM_DIR new_config['General']['fftonewcom_dir'] = int(FFTONEWCOM_DIR) new_config['SABnzbd'] = {} new_config['SABnzbd']['use_sabnzbd'] = int(USE_SABNZBD) new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_username'] = SAB_USERNAME new_config['SABnzbd']['sab_password'] = SAB_PASSWORD new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY new_config['SABnzbd']['sab_category'] = SAB_CATEGORY new_config['SABnzbd']['sab_priority'] = SAB_PRIORITY new_config['SABnzbd']['sab_directory'] = SAB_DIRECTORY new_config['NZBGet'] = {} new_config['NZBGet']['use_nzbget'] = int(USE_NZBGET) new_config['NZBGet']['nzbget_host'] = NZBGET_HOST new_config['NZBGet']['nzbget_port'] = NZBGET_PORT new_config['NZBGet']['nzbget_username'] = NZBGET_USERNAME new_config['NZBGet']['nzbget_password'] = NZBGET_PASSWORD new_config['NZBGet']['nzbget_category'] = NZBGET_CATEGORY new_config['NZBGet']['nzbget_priority'] = NZBGET_PRIORITY new_config['NZBsu'] = {} new_config['NZBsu']['nzbsu'] = int(NZBSU) new_config['NZBsu']['nzbsu_apikey'] = NZBSU_APIKEY new_config['DOGnzb'] = {} new_config['DOGnzb']['dognzb'] = int(DOGNZB) new_config['DOGnzb']['dognzb_apikey'] = DOGNZB_APIKEY new_config['nzbx'] = {} new_config['nzbx']['nzbx'] = int(NZBX) new_config['Experimental'] = {} new_config['Experimental']['experimental'] = int(EXPERIMENTAL) new_config['Newznab'] = {} new_config['Newznab']['newznab'] = int(NEWZNAB) # Need to unpack the extra newznabs for saving in config.ini flattened_newznabs = [] for newznab in EXTRA_NEWZNABS: for item in newznab: flattened_newznabs.append(item) new_config['Newznab']['extra_newznabs'] = flattened_newznabs new_config['Prowl'] = {} new_config['Prowl']['prowl_enabled'] = int(PROWL_ENABLED) new_config['Prowl']['prowl_keys'] = PROWL_KEYS new_config['Prowl']['prowl_onsnatch'] = int(PROWL_ONSNATCH) new_config['Prowl']['prowl_priority'] = int(PROWL_PRIORITY) new_config['NMA'] = {} new_config['NMA']['nma_enabled'] = int(NMA_ENABLED) new_config['NMA']['nma_apikey'] = NMA_APIKEY new_config['NMA']['nma_priority'] = NMA_PRIORITY new_config['NMA']['nma_onsnatch'] = int(NMA_ONSNATCH) new_config['PUSHOVER'] = {} new_config['PUSHOVER']['pushover_enabled'] = int(PUSHOVER_ENABLED) new_config['PUSHOVER']['pushover_apikey'] = PUSHOVER_APIKEY new_config['PUSHOVER']['pushover_userkey'] = PUSHOVER_USERKEY new_config['PUSHOVER']['pushover_priority'] = PUSHOVER_PRIORITY new_config['PUSHOVER']['pushover_onsnatch'] = int(PUSHOVER_ONSNATCH) new_config['Raw'] = {} new_config['Raw']['raw'] = int(RAW) new_config['Raw']['raw_provider'] = RAW_PROVIDER new_config['Raw']['raw_username'] = RAW_USERNAME new_config['Raw']['raw_password'] = RAW_PASSWORD new_config['Raw']['raw_groups'] = RAW_GROUPS new_config.write()
def config_write(): new_config = ConfigObj(encoding="UTF-8") new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['config_version'] = CONFIG_VERSION new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_username'] = HTTP_USERNAME new_config['General']['http_password'] = HTTP_PASSWORD new_config['General']['http_root'] = HTTP_ROOT new_config['General']['http_proxy'] = int(HTTP_PROXY) new_config['General']['enable_https'] = int(ENABLE_HTTPS) new_config['General']['https_cert'] = HTTPS_CERT new_config['General']['https_key'] = HTTPS_KEY new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['api_enabled'] = int(API_ENABLED) new_config['General']['api_key'] = API_KEY new_config['General']['log_dir'] = LOG_DIR new_config['General']['cache_dir'] = CACHE_DIR new_config['General']['git_path'] = GIT_PATH new_config['General']['git_user'] = GIT_USER new_config['General']['git_branch'] = GIT_BRANCH new_config['General']['check_github'] = int(CHECK_GITHUB) new_config['General']['check_github_on_startup'] = int(CHECK_GITHUB_ON_STARTUP) new_config['General']['check_github_interval'] = CHECK_GITHUB_INTERVAL new_config['General']['music_dir'] = MUSIC_DIR new_config['General']['destination_dir'] = DESTINATION_DIR new_config['General']['lossless_destination_dir'] = LOSSLESS_DESTINATION_DIR new_config['General']['preferred_quality'] = PREFERRED_QUALITY new_config['General']['preferred_bitrate'] = PREFERRED_BITRATE new_config['General']['preferred_bitrate_high_buffer'] = PREFERRED_BITRATE_HIGH_BUFFER new_config['General']['preferred_bitrate_low_buffer'] = PREFERRED_BITRATE_LOW_BUFFER new_config['General']['preferred_bitrate_allow_lossless'] = int(PREFERRED_BITRATE_ALLOW_LOSSLESS) new_config['General']['detect_bitrate'] = int(DETECT_BITRATE) new_config['General']['auto_add_artists'] = int(ADD_ARTISTS) new_config['General']['correct_metadata'] = int(CORRECT_METADATA) new_config['General']['move_files'] = int(MOVE_FILES) new_config['General']['rename_files'] = int(RENAME_FILES) new_config['General']['folder_format'] = FOLDER_FORMAT new_config['General']['file_format'] = FILE_FORMAT new_config['General']['file_underscores'] = int(FILE_UNDERSCORES) new_config['General']['cleanup_files'] = int(CLEANUP_FILES) new_config['General']['add_album_art'] = int(ADD_ALBUM_ART) new_config['General']['album_art_format'] = ALBUM_ART_FORMAT new_config['General']['embed_album_art'] = int(EMBED_ALBUM_ART) new_config['General']['embed_lyrics'] = int(EMBED_LYRICS) new_config['General']['nzb_downloader'] = NZB_DOWNLOADER new_config['General']['torrent_downloader'] = TORRENT_DOWNLOADER new_config['General']['download_dir'] = DOWNLOAD_DIR new_config['General']['blackhole_dir'] = BLACKHOLE_DIR new_config['General']['usenet_retention'] = USENET_RETENTION new_config['General']['include_extras'] = int(INCLUDE_EXTRAS) new_config['General']['extras'] = EXTRAS new_config['General']['autowant_upcoming'] = int(AUTOWANT_UPCOMING) new_config['General']['autowant_all'] = int(AUTOWANT_ALL) new_config['General']['keep_torrent_files'] = int(KEEP_TORRENT_FILES) new_config['General']['numberofseeders'] = NUMBEROFSEEDERS new_config['General']['torrentblackhole_dir'] = TORRENTBLACKHOLE_DIR new_config['General']['isohunt'] = int(ISOHUNT) new_config['General']['kat'] = int(KAT) new_config['General']['mininova'] = int(MININOVA) new_config['General']['piratebay'] = int(PIRATEBAY) new_config['General']['piratebay_proxy_url'] = PIRATEBAY_PROXY_URL new_config['General']['download_torrent_dir'] = DOWNLOAD_TORRENT_DIR new_config['Waffles'] = {} new_config['Waffles']['waffles'] = int(WAFFLES) new_config['Waffles']['waffles_uid'] = WAFFLES_UID new_config['Waffles']['waffles_passkey'] = WAFFLES_PASSKEY new_config['Rutracker'] = {} new_config['Rutracker']['rutracker'] = int(RUTRACKER) new_config['Rutracker']['rutracker_user'] = RUTRACKER_USER new_config['Rutracker']['rutracker_password'] = RUTRACKER_PASSWORD new_config['What.cd'] = {} new_config['What.cd']['whatcd'] = int(WHATCD) new_config['What.cd']['whatcd_username'] = WHATCD_USERNAME new_config['What.cd']['whatcd_password'] = WHATCD_PASSWORD new_config['General']['search_interval'] = SEARCH_INTERVAL new_config['General']['libraryscan'] = int(LIBRARYSCAN) new_config['General']['libraryscan_interval'] = LIBRARYSCAN_INTERVAL new_config['General']['download_scan_interval'] = DOWNLOAD_SCAN_INTERVAL new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_username'] = SAB_USERNAME new_config['SABnzbd']['sab_password'] = SAB_PASSWORD new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY new_config['SABnzbd']['sab_category'] = SAB_CATEGORY new_config['NZBget'] = {} new_config['NZBget']['nzbget_username'] = NZBGET_USERNAME new_config['NZBget']['nzbget_password'] = NZBGET_PASSWORD new_config['NZBget']['nzbget_category'] = NZBGET_CATEGORY new_config['NZBget']['nzbget_host'] = NZBGET_HOST new_config['Headphones'] = {} new_config['Headphones']['headphones_indexer'] = int(HEADPHONES_INDEXER) new_config['Transmission'] = {} new_config['Transmission']['transmission_host'] = TRANSMISSION_HOST new_config['Transmission']['transmission_username'] = TRANSMISSION_USERNAME new_config['Transmission']['transmission_password'] = TRANSMISSION_PASSWORD new_config['uTorrent'] = {} new_config['uTorrent']['utorrent_host'] = UTORRENT_HOST new_config['uTorrent']['utorrent_username'] = UTORRENT_USERNAME new_config['uTorrent']['utorrent_password'] = UTORRENT_PASSWORD new_config['Newznab'] = {} new_config['Newznab']['newznab'] = int(NEWZNAB) new_config['Newznab']['newznab_host'] = NEWZNAB_HOST new_config['Newznab']['newznab_apikey'] = NEWZNAB_APIKEY new_config['Newznab']['newznab_enabled'] = int(NEWZNAB_ENABLED) # Need to unpack the extra newznabs for saving in config.ini flattened_newznabs = [] for newznab in EXTRA_NEWZNABS: for item in newznab: flattened_newznabs.append(item) new_config['Newznab']['extra_newznabs'] = flattened_newznabs new_config['NZBsorg'] = {} new_config['NZBsorg']['nzbsorg'] = int(NZBSORG) new_config['NZBsorg']['nzbsorg_uid'] = NZBSORG_UID new_config['NZBsorg']['nzbsorg_hash'] = NZBSORG_HASH new_config['NZBsRus'] = {} new_config['NZBsRus']['nzbsrus'] = int(NZBSRUS) new_config['NZBsRus']['nzbsrus_uid'] = NZBSRUS_UID new_config['NZBsRus']['nzbsrus_apikey'] = NZBSRUS_APIKEY new_config['omgwtfnzbs'] = {} new_config['omgwtfnzbs']['omgwtfnzbs'] = int(OMGWTFNZBS) new_config['omgwtfnzbs']['omgwtfnzbs_uid'] = OMGWTFNZBS_UID new_config['omgwtfnzbs']['omgwtfnzbs_apikey'] = OMGWTFNZBS_APIKEY new_config['General']['preferred_words'] = PREFERRED_WORDS new_config['General']['ignored_words'] = IGNORED_WORDS new_config['General']['required_words'] = REQUIRED_WORDS new_config['Prowl'] = {} new_config['Prowl']['prowl_enabled'] = int(PROWL_ENABLED) new_config['Prowl']['prowl_keys'] = PROWL_KEYS new_config['Prowl']['prowl_onsnatch'] = int(PROWL_ONSNATCH) new_config['Prowl']['prowl_priority'] = int(PROWL_PRIORITY) new_config['XBMC'] = {} new_config['XBMC']['xbmc_enabled'] = int(XBMC_ENABLED) new_config['XBMC']['xbmc_host'] = XBMC_HOST new_config['XBMC']['xbmc_username'] = XBMC_USERNAME new_config['XBMC']['xbmc_password'] = XBMC_PASSWORD new_config['XBMC']['xbmc_update'] = int(XBMC_UPDATE) new_config['XBMC']['xbmc_notify'] = int(XBMC_NOTIFY) new_config['NMA'] = {} new_config['NMA']['nma_enabled'] = int(NMA_ENABLED) new_config['NMA']['nma_apikey'] = NMA_APIKEY new_config['NMA']['nma_priority'] = NMA_PRIORITY new_config['NMA']['nma_onsnatch'] = int(PROWL_ONSNATCH) new_config['Pushover'] = {} new_config['Pushover']['pushover_enabled'] = int(PUSHOVER_ENABLED) new_config['Pushover']['pushover_keys'] = PUSHOVER_KEYS new_config['Pushover']['pushover_onsnatch'] = int(PUSHOVER_ONSNATCH) new_config['Pushover']['pushover_priority'] = int(PUSHOVER_PRIORITY) new_config['Synoindex'] = {} new_config['Synoindex']['synoindex_enabled'] = int(SYNOINDEX_ENABLED) new_config['General']['lastfm_username'] = LASTFM_USERNAME new_config['General']['interface'] = INTERFACE new_config['General']['folder_permissions'] = FOLDER_PERMISSIONS new_config['General']['file_permissions'] = FILE_PERMISSIONS new_config['General']['music_encoder'] = int(MUSIC_ENCODER) new_config['General']['encoder'] = ENCODER new_config['General']['xldprofile'] = XLDPROFILE new_config['General']['bitrate'] = int(BITRATE) new_config['General']['samplingfrequency'] = int(SAMPLINGFREQUENCY) new_config['General']['encoder_path'] = ENCODER_PATH new_config['General']['advancedencoder'] = ADVANCEDENCODER new_config['General']['encoderoutputformat'] = ENCODEROUTPUTFORMAT new_config['General']['encoderquality'] = ENCODERQUALITY new_config['General']['encodervbrcbr'] = ENCODERVBRCBR new_config['General']['encoderlossless'] = int(ENCODERLOSSLESS) new_config['General']['delete_lossless_files'] = int(DELETE_LOSSLESS_FILES) new_config['General']['mirror'] = MIRROR new_config['General']['customhost'] = CUSTOMHOST new_config['General']['customport'] = CUSTOMPORT new_config['General']['customsleep'] = CUSTOMSLEEP new_config['General']['hpuser'] = HPUSER new_config['General']['hppass'] = HPPASS new_config['Advanced'] = {} new_config['Advanced']['album_completion_pct'] = ALBUM_COMPLETION_PCT new_config['Advanced']['cache_sizemb'] = CACHE_SIZEMB new_config['Advanced']['journal_mode'] = JOURNAL_MODE new_config.write()
def save_config(): new_config = ConfigObj() new_config.filename = sickbeard.CONFIG_FILE new_config['General'] = {} new_config['General']['log_dir'] = LOG_DIR new_config['General']['web_port'] = WEB_PORT new_config['General']['web_host'] = WEB_HOST new_config['General']['web_ipv6'] = 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'] = WEB_PASSWORD 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']['usenet_retention'] = int(USENET_RETENTION) new_config['General']['search_frequency'] = int(SEARCH_FREQUENCY) new_config['General']['download_propers'] = int(DOWNLOAD_PROPERS) new_config['General']['quality_default'] = int(QUALITY_DEFAULT) new_config['General']['status_default'] = int(STATUS_DEFAULT) new_config['General']['season_folders_format'] = SEASON_FOLDERS_FORMAT new_config['General']['season_folders_default'] = int( SEASON_FOLDERS_DEFAULT) new_config['General']['provider_order'] = ' '.join( [x.getID() for x in providers.sortedProviderList()]) new_config['General']['version_notify'] = int(VERSION_NOTIFY) new_config['General']['naming_ep_name'] = int(NAMING_EP_NAME) new_config['General']['naming_show_name'] = int(NAMING_SHOW_NAME) new_config['General']['naming_ep_type'] = int(NAMING_EP_TYPE) new_config['General']['naming_multi_ep_type'] = int(NAMING_MULTI_EP_TYPE) new_config['General']['naming_sep_type'] = int(NAMING_SEP_TYPE) new_config['General']['naming_use_periods'] = int(NAMING_USE_PERIODS) new_config['General']['naming_quality'] = int(NAMING_QUALITY) new_config['General']['naming_dates'] = int(NAMING_DATES) new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['use_banner'] = int(USE_BANNER) new_config['General']['use_listview'] = int(USE_LISTVIEW) new_config['General']['metadata_xbmc'] = metadata_provider_dict[ 'XBMC'].get_config() new_config['General']['metadata_mediabrowser'] = metadata_provider_dict[ 'MediaBrowser'].get_config() new_config['General']['metadata_ps3'] = metadata_provider_dict[ 'Sony PS3'].get_config() new_config['General']['metadata_wdtv'] = metadata_provider_dict[ 'WDTV'].get_config() new_config['General']['cache_dir'] = CACHE_DIR if 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']['move_associated_files'] = int(MOVE_ASSOCIATED_FILES) new_config['General']['process_automatically'] = int(PROCESS_AUTOMATICALLY) new_config['General']['rename_episodes'] = int(RENAME_EPISODES) new_config['General']['extra_scripts'] = '|'.join(EXTRA_SCRIPTS) new_config['General']['git_path'] = GIT_PATH new_config['Blackhole'] = {} new_config['Blackhole']['nzb_dir'] = NZB_DIR new_config['Blackhole']['torrent_dir'] = TORRENT_DIR new_config['EZRSS'] = {} new_config['EZRSS']['ezrss'] = int(EZRSS) new_config['TVTORRENTS'] = {} new_config['TVTORRENTS']['tvtorrents'] = int(TVTORRENTS) new_config['TVTORRENTS']['tvtorrents_digest'] = TVTORRENTS_DIGEST new_config['TVTORRENTS']['tvtorrents_hash'] = TVTORRENTS_HASH new_config['TVBinz'] = {} new_config['TVBinz']['tvbinz'] = int(TVBINZ) new_config['TVBinz']['tvbinz_uid'] = TVBINZ_UID new_config['TVBinz']['tvbinz_hash'] = TVBINZ_HASH new_config['TVBinz']['tvbinz_auth'] = TVBINZ_AUTH 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['NZBsRUS'] = {} new_config['NZBsRUS']['nzbsrus'] = int(NZBSRUS) new_config['NZBsRUS']['nzbsrus_uid'] = NZBSRUS_UID new_config['NZBsRUS']['nzbsrus_hash'] = NZBSRUS_HASH new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_username'] = NZBMATRIX_USERNAME new_config['NZBMatrix']['nzbmatrix_apikey'] = NZBMATRIX_APIKEY new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_username'] = NEWZBIN_USERNAME new_config['Newzbin']['newzbin_password'] = NEWZBIN_PASSWORD new_config['Womble'] = {} new_config['Womble']['womble'] = int(WOMBLE) new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_username'] = SAB_USERNAME new_config['SABnzbd']['sab_password'] = SAB_PASSWORD new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY new_config['SABnzbd']['sab_category'] = SAB_CATEGORY new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['NZBget'] = {} new_config['NZBget']['nzbget_password'] = NZBGET_PASSWORD new_config['NZBget']['nzbget_category'] = NZBGET_CATEGORY new_config['NZBget']['nzbget_host'] = NZBGET_HOST new_config['XBMC'] = {} new_config['XBMC']['use_xbmc'] = int(USE_XBMC) new_config['XBMC']['xbmc_notify_onsnatch'] = int(XBMC_NOTIFY_ONSNATCH) new_config['XBMC']['xbmc_notify_ondownload'] = int(XBMC_NOTIFY_ONDOWNLOAD) new_config['XBMC']['xbmc_update_library'] = int(XBMC_UPDATE_LIBRARY) new_config['XBMC']['xbmc_update_full'] = int(XBMC_UPDATE_FULL) new_config['XBMC']['xbmc_host'] = XBMC_HOST new_config['XBMC']['xbmc_username'] = XBMC_USERNAME new_config['XBMC']['xbmc_password'] = XBMC_PASSWORD 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_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'] = PLEX_PASSWORD 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_host'] = GROWL_HOST new_config['Growl']['growl_password'] = GROWL_PASSWORD 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_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_username'] = TWITTER_USERNAME new_config['Twitter']['twitter_password'] = TWITTER_PASSWORD new_config['Twitter']['twitter_prefix'] = TWITTER_PREFIX new_config['Notifo'] = {} new_config['Notifo']['use_notifo'] = int(USE_NOTIFO) new_config['Notifo']['notifo_notify_onsnatch'] = int( NOTIFO_NOTIFY_ONSNATCH) new_config['Notifo']['notifo_notify_ondownload'] = int( NOTIFO_NOTIFY_ONDOWNLOAD) new_config['Notifo']['notifo_username'] = NOTIFO_USERNAME new_config['Notifo']['notifo_apisecret'] = NOTIFO_APISECRET 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['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['Newznab'] = {} new_config['Newznab']['newznab_data'] = '!!!'.join( [x.configStr() for x in newznabProviderList]) new_config['GUI'] = {} 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.write()
def config_write(): new_config = ConfigObj(encoding="UTF-8") new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['config_version'] = CONFIG_VERSION new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_username'] = HTTP_USERNAME new_config['General']['http_password'] = HTTP_PASSWORD new_config['General']['http_root'] = HTTP_ROOT new_config['General']['http_proxy'] = int(HTTP_PROXY) new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['api_enabled'] = int(API_ENABLED) new_config['General']['api_key'] = API_KEY new_config['General']['log_dir'] = LOG_DIR new_config['General']['cache_dir'] = CACHE_DIR new_config['General']['git_path'] = GIT_PATH new_config['General']['git_user'] = GIT_USER new_config['General']['git_branch'] = GIT_BRANCH new_config['General']['check_github'] = int(CHECK_GITHUB) new_config['General']['check_github_on_startup'] = int( CHECK_GITHUB_ON_STARTUP) new_config['General']['check_github_interval'] = CHECK_GITHUB_INTERVAL new_config['General']['music_dir'] = MUSIC_DIR new_config['General']['destination_dir'] = DESTINATION_DIR new_config['General'][ 'lossless_destination_dir'] = LOSSLESS_DESTINATION_DIR new_config['General']['preferred_quality'] = PREFERRED_QUALITY new_config['General']['preferred_bitrate'] = PREFERRED_BITRATE new_config['General'][ 'preferred_bitrate_high_buffer'] = PREFERRED_BITRATE_HIGH_BUFFER new_config['General'][ 'preferred_bitrate_low_buffer'] = PREFERRED_BITRATE_LOW_BUFFER new_config['General']['preferred_bitrate_allow_lossless'] = int( PREFERRED_BITRATE_ALLOW_LOSSLESS) new_config['General']['detect_bitrate'] = int(DETECT_BITRATE) new_config['General']['auto_add_artists'] = int(ADD_ARTISTS) new_config['General']['correct_metadata'] = int(CORRECT_METADATA) new_config['General']['move_files'] = int(MOVE_FILES) new_config['General']['rename_files'] = int(RENAME_FILES) new_config['General']['folder_format'] = FOLDER_FORMAT new_config['General']['file_format'] = FILE_FORMAT new_config['General']['cleanup_files'] = int(CLEANUP_FILES) new_config['General']['add_album_art'] = int(ADD_ALBUM_ART) new_config['General']['album_art_format'] = ALBUM_ART_FORMAT new_config['General']['embed_album_art'] = int(EMBED_ALBUM_ART) new_config['General']['embed_lyrics'] = int(EMBED_LYRICS) new_config['General']['nzb_downloader'] = NZB_DOWNLOADER new_config['General']['download_dir'] = DOWNLOAD_DIR new_config['General']['blackhole_dir'] = BLACKHOLE_DIR new_config['General']['usenet_retention'] = USENET_RETENTION new_config['General']['include_extras'] = int(INCLUDE_EXTRAS) new_config['General']['extras'] = EXTRAS new_config['General']['autowant_upcoming'] = int(AUTOWANT_UPCOMING) new_config['General']['autowant_all'] = int(AUTOWANT_ALL) new_config['General']['keep_torrent_files'] = int(KEEP_TORRENT_FILES) new_config['General']['numberofseeders'] = NUMBEROFSEEDERS new_config['General']['torrentblackhole_dir'] = TORRENTBLACKHOLE_DIR new_config['General']['isohunt'] = int(ISOHUNT) new_config['General']['kat'] = int(KAT) new_config['General']['mininova'] = int(MININOVA) new_config['General']['download_torrent_dir'] = DOWNLOAD_TORRENT_DIR new_config['Waffles'] = {} new_config['Waffles']['waffles'] = int(WAFFLES) new_config['Waffles']['waffles_uid'] = WAFFLES_UID new_config['Waffles']['waffles_passkey'] = WAFFLES_PASSKEY new_config['Rutracker'] = {} new_config['Rutracker']['rutracker'] = int(RUTRACKER) new_config['Rutracker']['rutracker_user'] = RUTRACKER_USER new_config['Rutracker']['rutracker_password'] = RUTRACKER_PASSWORD new_config['What.cd'] = {} new_config['What.cd']['whatcd'] = int(WHATCD) new_config['What.cd']['whatcd_username'] = WHATCD_USERNAME new_config['What.cd']['whatcd_password'] = WHATCD_PASSWORD new_config['General']['search_interval'] = SEARCH_INTERVAL new_config['General']['libraryscan'] = int(LIBRARYSCAN) new_config['General']['libraryscan_interval'] = LIBRARYSCAN_INTERVAL new_config['General']['download_scan_interval'] = DOWNLOAD_SCAN_INTERVAL new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_username'] = SAB_USERNAME new_config['SABnzbd']['sab_password'] = SAB_PASSWORD new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY new_config['SABnzbd']['sab_category'] = SAB_CATEGORY new_config['NZBget'] = {} new_config['NZBget']['nzbget_username'] = NZBGET_USERNAME new_config['NZBget']['nzbget_password'] = NZBGET_PASSWORD new_config['NZBget']['nzbget_category'] = NZBGET_CATEGORY new_config['NZBget']['nzbget_host'] = NZBGET_HOST new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_username'] = NZBMATRIX_USERNAME new_config['NZBMatrix']['nzbmatrix_apikey'] = NZBMATRIX_APIKEY new_config['Newznab'] = {} new_config['Newznab']['newznab'] = int(NEWZNAB) new_config['Newznab']['newznab_host'] = NEWZNAB_HOST new_config['Newznab']['newznab_apikey'] = NEWZNAB_APIKEY new_config['Newznab']['newznab_enabled'] = int(NEWZNAB_ENABLED) # Need to unpack the extra newznabs for saving in config.ini flattened_newznabs = [] for newznab in EXTRA_NEWZNABS: for item in newznab: flattened_newznabs.append(item) new_config['Newznab']['extra_newznabs'] = flattened_newznabs new_config['NZBsorg'] = {} new_config['NZBsorg']['nzbsorg'] = int(NZBSORG) new_config['NZBsorg']['nzbsorg_uid'] = NZBSORG_UID new_config['NZBsorg']['nzbsorg_hash'] = NZBSORG_HASH new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_uid'] = NEWZBIN_UID new_config['Newzbin']['newzbin_password'] = NEWZBIN_PASSWORD new_config['NZBsRus'] = {} new_config['NZBsRus']['nzbsrus'] = int(NZBSRUS) new_config['NZBsRus']['nzbsrus_uid'] = NZBSRUS_UID new_config['NZBsRus']['nzbsrus_apikey'] = NZBSRUS_APIKEY new_config['nzbX'] = {} new_config['nzbX']['nzbx'] = int(NZBX) new_config['General']['preferred_words'] = PREFERRED_WORDS new_config['General']['ignored_words'] = IGNORED_WORDS new_config['General']['required_words'] = REQUIRED_WORDS new_config['Prowl'] = {} new_config['Prowl']['prowl_enabled'] = int(PROWL_ENABLED) new_config['Prowl']['prowl_keys'] = PROWL_KEYS new_config['Prowl']['prowl_onsnatch'] = int(PROWL_ONSNATCH) new_config['Prowl']['prowl_priority'] = int(PROWL_PRIORITY) new_config['XBMC'] = {} new_config['XBMC']['xbmc_enabled'] = int(XBMC_ENABLED) new_config['XBMC']['xbmc_host'] = XBMC_HOST new_config['XBMC']['xbmc_username'] = XBMC_USERNAME new_config['XBMC']['xbmc_password'] = XBMC_PASSWORD new_config['XBMC']['xbmc_update'] = int(XBMC_UPDATE) new_config['XBMC']['xbmc_notify'] = int(XBMC_NOTIFY) new_config['NMA'] = {} new_config['NMA']['nma_enabled'] = int(NMA_ENABLED) new_config['NMA']['nma_apikey'] = NMA_APIKEY new_config['NMA']['nma_priority'] = NMA_PRIORITY new_config['NMA']['nma_onsnatch'] = int(PROWL_ONSNATCH) new_config['Pushover'] = {} new_config['Pushover']['pushover_enabled'] = int(PUSHOVER_ENABLED) new_config['Pushover']['pushover_keys'] = PUSHOVER_KEYS new_config['Pushover']['pushover_onsnatch'] = int(PUSHOVER_ONSNATCH) new_config['Pushover']['pushover_priority'] = int(PUSHOVER_PRIORITY) new_config['Synoindex'] = {} new_config['Synoindex']['synoindex_enabled'] = int(SYNOINDEX_ENABLED) new_config['General']['lastfm_username'] = LASTFM_USERNAME new_config['General']['interface'] = INTERFACE new_config['General']['folder_permissions'] = FOLDER_PERMISSIONS new_config['General']['music_encoder'] = int(MUSIC_ENCODER) new_config['General']['encoder'] = ENCODER new_config['General']['xldprofile'] = XLDPROFILE new_config['General']['bitrate'] = int(BITRATE) new_config['General']['samplingfrequency'] = int(SAMPLINGFREQUENCY) new_config['General']['encoder_path'] = ENCODER_PATH new_config['General']['advancedencoder'] = ADVANCEDENCODER new_config['General']['encoderoutputformat'] = ENCODEROUTPUTFORMAT new_config['General']['encoderquality'] = ENCODERQUALITY new_config['General']['encodervbrcbr'] = ENCODERVBRCBR new_config['General']['encoderlossless'] = int(ENCODERLOSSLESS) new_config['General']['delete_lossless_files'] = int(DELETE_LOSSLESS_FILES) new_config['General']['mirror'] = MIRROR new_config['General']['customhost'] = CUSTOMHOST new_config['General']['customport'] = CUSTOMPORT new_config['General']['customsleep'] = CUSTOMSLEEP new_config['General']['hpuser'] = HPUSER new_config['General']['hppass'] = HPPASS new_config['Advanced'] = {} new_config['Advanced']['album_completion_pct'] = ALBUM_COMPLETION_PCT new_config['Advanced']['cache_sizemb'] = CACHE_SIZEMB new_config.write()
def save_config(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config["General"] = {} new_config["General"]["log_dir"] = LOG_DIR 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"] = WEB_PASSWORD new_config["General"]["use_api"] = int(USE_API) new_config["General"]["api_key"] = API_KEY 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"]["usenet_retention"] = int(USENET_RETENTION) new_config["General"]["search_frequency"] = int(SEARCH_FREQUENCY) new_config["General"]["download_propers"] = int(DOWNLOAD_PROPERS) new_config["General"]["quality_default"] = int(QUALITY_DEFAULT) new_config["General"]["status_default"] = int(STATUS_DEFAULT) new_config["General"]["season_folders_format"] = SEASON_FOLDERS_FORMAT new_config["General"]["season_folders_default"] = int(SEASON_FOLDERS_DEFAULT) new_config["General"]["provider_order"] = " ".join([x.getID() for x in providers.sortedProviderList()]) new_config["General"]["version_notify"] = int(VERSION_NOTIFY) new_config["General"]["naming_ep_name"] = int(NAMING_EP_NAME) new_config["General"]["naming_show_name"] = int(NAMING_SHOW_NAME) new_config["General"]["naming_ep_type"] = int(NAMING_EP_TYPE) new_config["General"]["naming_multi_ep_type"] = int(NAMING_MULTI_EP_TYPE) new_config["General"]["naming_sep_type"] = int(NAMING_SEP_TYPE) new_config["General"]["naming_use_periods"] = int(NAMING_USE_PERIODS) new_config["General"]["naming_quality"] = int(NAMING_QUALITY) new_config["General"]["naming_dates"] = int(NAMING_DATES) new_config["General"]["launch_browser"] = int(LAUNCH_BROWSER) new_config["General"]["use_banner"] = int(USE_BANNER) new_config["General"]["use_listview"] = int(USE_LISTVIEW) new_config["General"]["metadata_xbmc"] = metadata_provider_dict["XBMC"].get_config() new_config["General"]["metadata_mediabrowser"] = metadata_provider_dict["MediaBrowser"].get_config() new_config["General"]["metadata_ps3"] = metadata_provider_dict["Sony PS3"].get_config() new_config["General"]["metadata_wdtv"] = metadata_provider_dict["WDTV"].get_config() new_config["General"]["metadata_tivo"] = metadata_provider_dict["TIVO"].get_config() 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"]["move_associated_files"] = int(MOVE_ASSOCIATED_FILES) new_config["General"]["process_automatically"] = int(PROCESS_AUTOMATICALLY) new_config["General"]["rename_episodes"] = int(RENAME_EPISODES) new_config["General"]["extra_scripts"] = "|".join(EXTRA_SCRIPTS) new_config["General"]["git_path"] = GIT_PATH new_config["General"]["ignore_words"] = IGNORE_WORDS new_config["Blackhole"] = {} new_config["Blackhole"]["nzb_dir"] = NZB_DIR new_config["Blackhole"]["torrent_dir"] = TORRENT_DIR new_config["EZRSS"] = {} new_config["EZRSS"]["ezrss"] = int(EZRSS) new_config["TVTORRENTS"] = {} new_config["TVTORRENTS"]["tvtorrents"] = int(TVTORRENTS) new_config["TVTORRENTS"]["tvtorrents_digest"] = TVTORRENTS_DIGEST new_config["TVTORRENTS"]["tvtorrents_hash"] = TVTORRENTS_HASH 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["NZBsRUS"] = {} new_config["NZBsRUS"]["nzbsrus"] = int(NZBSRUS) new_config["NZBsRUS"]["nzbsrus_uid"] = NZBSRUS_UID new_config["NZBsRUS"]["nzbsrus_hash"] = NZBSRUS_HASH new_config["NZBMatrix"] = {} new_config["NZBMatrix"]["nzbmatrix"] = int(NZBMATRIX) new_config["NZBMatrix"]["nzbmatrix_username"] = NZBMATRIX_USERNAME new_config["NZBMatrix"]["nzbmatrix_apikey"] = NZBMATRIX_APIKEY new_config["Newzbin"] = {} new_config["Newzbin"]["newzbin"] = int(NEWZBIN) new_config["Newzbin"]["newzbin_username"] = NEWZBIN_USERNAME new_config["Newzbin"]["newzbin_password"] = NEWZBIN_PASSWORD new_config["Womble"] = {} new_config["Womble"]["womble"] = int(WOMBLE) new_config["SABnzbd"] = {} new_config["SABnzbd"]["sab_username"] = SAB_USERNAME new_config["SABnzbd"]["sab_password"] = SAB_PASSWORD new_config["SABnzbd"]["sab_apikey"] = SAB_APIKEY new_config["SABnzbd"]["sab_category"] = SAB_CATEGORY new_config["SABnzbd"]["sab_host"] = SAB_HOST new_config["NZBget"] = {} new_config["NZBget"]["nzbget_password"] = NZBGET_PASSWORD new_config["NZBget"]["nzbget_category"] = NZBGET_CATEGORY new_config["NZBget"]["nzbget_host"] = NZBGET_HOST new_config["XBMC"] = {} new_config["XBMC"]["use_xbmc"] = int(USE_XBMC) new_config["XBMC"]["xbmc_notify_onsnatch"] = int(XBMC_NOTIFY_ONSNATCH) new_config["XBMC"]["xbmc_notify_ondownload"] = int(XBMC_NOTIFY_ONDOWNLOAD) new_config["XBMC"]["xbmc_update_library"] = int(XBMC_UPDATE_LIBRARY) new_config["XBMC"]["xbmc_update_full"] = int(XBMC_UPDATE_FULL) new_config["XBMC"]["xbmc_host"] = XBMC_HOST new_config["XBMC"]["xbmc_username"] = XBMC_USERNAME new_config["XBMC"]["xbmc_password"] = XBMC_PASSWORD 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_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"] = PLEX_PASSWORD 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_host"] = GROWL_HOST new_config["Growl"]["growl_password"] = GROWL_PASSWORD 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_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_username"] = TWITTER_USERNAME new_config["Twitter"]["twitter_password"] = TWITTER_PASSWORD new_config["Twitter"]["twitter_prefix"] = TWITTER_PREFIX new_config["Notifo"] = {} new_config["Notifo"]["use_notifo"] = int(USE_NOTIFO) new_config["Notifo"]["notifo_notify_onsnatch"] = int(NOTIFO_NOTIFY_ONSNATCH) new_config["Notifo"]["notifo_notify_ondownload"] = int(NOTIFO_NOTIFY_ONDOWNLOAD) new_config["Notifo"]["notifo_username"] = NOTIFO_USERNAME new_config["Notifo"]["notifo_apisecret"] = NOTIFO_APISECRET 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_username"] = BOXCAR_USERNAME 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["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["Synology"] = {} new_config["Synology"]["use_synoindex"] = int(USE_SYNOINDEX) new_config["Trakt"] = {} new_config["Trakt"]["use_trakt"] = int(USE_TRAKT) new_config["Trakt"]["trakt_username"] = TRAKT_USERNAME new_config["Trakt"]["trakt_password"] = TRAKT_PASSWORD new_config["Trakt"]["trakt_api"] = TRAKT_API 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_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["Newznab"] = {} new_config["Newznab"]["newznab_data"] = "!!!".join([x.configStr() for x in newznabProviderList]) new_config["GUI"] = {} 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.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIGFILE new_config['General'] = {} new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_user'] = HTTP_USER new_config['General']['http_pass'] = HTTP_PASS new_config['General']['http_root'] = HTTP_ROOT new_config['General']['http_look'] = HTTP_LOOK new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['logdir'] = LOGDIR new_config['General']['loglevel'] = int(LOGLEVEL) new_config['General']['imp_onlyisbn'] = int(IMP_ONLYISBN) new_config['General']['imp_preflang'] = IMP_PREFLANG new_config['General']['imp_autoadd'] = IMP_AUTOADD new_config['General']['ebook_type'] = EBOOK_TYPE new_config['Git'] = {} new_config['Git']['git_user'] = GIT_USER new_config['Git']['git_repo'] = GIT_REPO new_config['Git']['git_branch'] = GIT_BRANCH new_config['Git']['install_type'] = INSTALL_TYPE new_config['Git']['current_version'] = CURRENT_VERSION new_config['Git']['latest_version'] = LATEST_VERSION new_config['Git']['commits_behind'] = COMMITS_BEHIND new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_port'] = SAB_PORT new_config['SABnzbd']['sab_subdir'] = SAB_SUBDIR new_config['SABnzbd']['sab_user'] = SAB_USER new_config['SABnzbd']['sab_pass'] = SAB_PASS new_config['SABnzbd']['sab_api'] = SAB_API new_config['SABnzbd']['sab_cat'] = SAB_CAT new_config['General']['destination_dir'] = DESTINATION_DIR new_config['General']['destination_copy'] = int(DESTINATION_COPY) new_config['General']['download_dir'] = DOWNLOAD_DIR new_config['General']['blackhole'] = int(BLACKHOLE) new_config['General']['blackholedir'] = BLACKHOLEDIR new_config['General']['usenet_retention'] = USENET_RETENTION new_config['API'] = {} new_config['API']['book_api'] = BOOK_API new_config['API']['gr_api'] = GR_API new_config['API']['gb_api'] = GB_API new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_user'] = NZBMATRIX_USER new_config['NZBMatrix']['nzbmatrix_api'] = NZBMATRIX_API new_config['Newznab'] = {} new_config['Newznab']['newznab'] = int(NEWZNAB) new_config['Newznab']['newznab_host'] = NEWZNAB_HOST new_config['Newznab']['newznab_api'] = NEWZNAB_API new_config['Newznab2'] = {} new_config['Newznab2']['newznab2'] = int(NEWZNAB2) new_config['Newznab2']['newznab_host2'] = NEWZNAB_HOST2 new_config['Newznab2']['newznab_api2'] = NEWZNAB_API2 new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_uid'] = NEWZBIN_UID new_config['Newzbin']['newzbin_pass'] = NEWZBIN_PASS new_config['UsenetCrawler'] = {} new_config['UsenetCrawler']['usenetcrawler'] = int(USENETCRAWLER) new_config['UsenetCrawler']['usenetcrawler_host'] = USENETCRAWLER_HOST new_config['UsenetCrawler']['usenetcrawler_api'] = USENETCRAWLER_API new_config['SearchScan'] = {} new_config['SearchScan']['search_interval'] = SEARCH_INTERVAL new_config['SearchScan']['scan_interval'] = SCAN_INTERVAL new_config['SearchScan']['versioncheck_interval'] = VERSIONCHECK_INTERVAL new_config['PostProcess'] = {} new_config['PostProcess']['ebook_dest_folder'] = EBOOK_DEST_FOLDER new_config['PostProcess']['ebook_dest_file'] = EBOOK_DEST_FILE new_config['PostProcess']['mag_dest_folder'] = MAG_DEST_FOLDER new_config['PostProcess']['mag_dest_file'] = MAG_DEST_FILE 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_username'] = TWITTER_USERNAME new_config['Twitter']['twitter_password'] = TWITTER_PASSWORD new_config['Twitter']['twitter_prefix'] = TWITTER_PREFIX new_config.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIGFILE new_config['General'] = {} new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_user'] = HTTP_USER new_config['General']['http_pass'] = HTTP_PASS new_config['General']['http_root'] = HTTP_ROOT new_config['General']['http_look'] = HTTP_LOOK new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['proxy_host'] = PROXY_HOST new_config['General']['proxy_type'] = PROXY_TYPE new_config['General']['logdir'] = LOGDIR new_config['General']['loglevel'] = int(LOGLEVEL) new_config['General']['match_ratio'] = int(MATCH_RATIO) new_config['General']['imp_onlyisbn'] = int(IMP_ONLYISBN) new_config['General']['imp_singlebook'] = int(IMP_SINGLEBOOK) new_config['General']['imp_preflang'] = IMP_PREFLANG new_config['General']['imp_monthlang'] = IMP_MONTHLANG new_config['General']['imp_autoadd'] = IMP_AUTOADD new_config['General']['ebook_type'] = EBOOK_TYPE new_config['Git'] = {} new_config['Git']['git_user'] = GIT_USER new_config['Git']['git_repo'] = GIT_REPO new_config['Git']['git_branch'] = GIT_BRANCH new_config['Git']['install_type'] = INSTALL_TYPE new_config['Git']['current_version'] = CURRENT_VERSION new_config['Git']['latest_version'] = LATEST_VERSION new_config['Git']['commits_behind'] = COMMITS_BEHIND new_config['USENET'] = {} new_config['USENET']['nzb_downloader_sabnzbd'] = int(NZB_DOWNLOADER_SABNZBD) new_config['USENET']['nzb_downloader_nzbget'] = int(NZB_DOWNLOADER_NZBGET) new_config['USENET']['nzb_downloader_blackhole'] = int(NZB_DOWNLOADER_BLACKHOLE) new_config['USENET']['nzb_blackholedir'] = NZB_BLACKHOLEDIR new_config['USENET']['usenet_retention'] = USENET_RETENTION new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_port'] = SAB_PORT new_config['SABnzbd']['sab_subdir'] = SAB_SUBDIR new_config['SABnzbd']['sab_user'] = SAB_USER new_config['SABnzbd']['sab_pass'] = SAB_PASS new_config['SABnzbd']['sab_api'] = SAB_API new_config['SABnzbd']['sab_cat'] = SAB_CAT new_config['NZBGet'] = {} new_config['NZBGet']['nzbget_host'] = NZBGET_HOST new_config['NZBGet']['nzbget_user'] = NZBGET_USER new_config['NZBGet']['nzbget_pass'] = NZBGET_PASS new_config['NZBGet']['nzbget_cat'] = NZBGET_CATEGORY new_config['NZBGet']['nzbget_priority'] = NZBGET_PRIORITY new_config['General']['destination_dir'] = DESTINATION_DIR new_config['General']['destination_copy'] = int(DESTINATION_COPY) new_config['General']['download_dir'] = DOWNLOAD_DIR new_config['DLMethod'] = {} new_config['DLMethod']['use_tor'] = int(USE_TOR) new_config['DLMethod']['use_nzb'] = int(USE_NZB) new_config['API'] = {} new_config['API']['book_api'] = BOOK_API new_config['API']['gr_api'] = GR_API new_config['API']['gb_api'] = GB_API new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_user'] = NZBMATRIX_USER new_config['NZBMatrix']['nzbmatrix_api'] = NZBMATRIX_API new_config['Newznab0'] = {} new_config['Newznab0']['newznab0'] = int(NEWZNAB0) new_config['Newznab0']['newznab_host0'] = NEWZNAB_HOST0 new_config['Newznab0']['newznab_api0'] = NEWZNAB_API0 new_config['Newznab1'] = {} new_config['Newznab1']['newznab1'] = int(NEWZNAB1) new_config['Newznab1']['newznab_host1'] = NEWZNAB_HOST1 new_config['Newznab1']['newznab_api1'] = NEWZNAB_API1 new_config['Newznab2'] = {} new_config['Newznab2']['newznab2'] = int(NEWZNAB2) new_config['Newznab2']['newznab_host2'] = NEWZNAB_HOST2 new_config['Newznab2']['newznab_api2'] = NEWZNAB_API2 new_config['Newznab3'] = {} new_config['Newznab3']['newznab3'] = int(NEWZNAB3) new_config['Newznab3']['newznab_host3'] = NEWZNAB_HOST3 new_config['Newznab3']['newznab_api3'] = NEWZNAB_API3 new_config['Newznab4'] = {} new_config['Newznab4']['newznab4'] = int(NEWZNAB4) new_config['Newznab4']['newznab_host4'] = NEWZNAB_HOST4 new_config['Newznab4']['newznab_api4'] = NEWZNAB_API4 new_config['Torznab0'] = {} new_config['Torznab0']['torznab0'] = int(TORZNAB0) new_config['Torznab0']['torznab_host0'] = TORZNAB_HOST0 new_config['Torznab0']['torznab_api0'] = TORZNAB_API0 new_config['Torznab1'] = {} new_config['Torznab1']['torznab1'] = int(TORZNAB1) new_config['Torznab1']['torznab_host1'] = TORZNAB_HOST1 new_config['Torznab1']['torznab_api1'] = TORZNAB_API1 new_config['Torznab2'] = {} new_config['Torznab2']['torznab2'] = int(TORZNAB2) new_config['Torznab2']['torznab_host2'] = TORZNAB_HOST2 new_config['Torznab2']['torznab_api2'] = TORZNAB_API2 new_config['Torznab3'] = {} new_config['Torznab3']['torznab3'] = int(TORZNAB3) new_config['Torznab3']['torznab_host3'] = TORZNAB_HOST3 new_config['Torznab3']['torznab_api3'] = TORZNAB_API3 new_config['Torznab4'] = {} new_config['Torznab4']['torznab4'] = int(TORZNAB4) new_config['Torznab4']['torznab_host4'] = TORZNAB_HOST4 new_config['Torznab4']['torznab_api4'] = TORZNAB_API4 new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_uid'] = NEWZBIN_UID new_config['Newzbin']['newzbin_pass'] = NEWZBIN_PASS new_config['TORRENT'] = {} new_config['TORRENT']['tor_downloader_blackhole'] = int(TOR_DOWNLOADER_BLACKHOLE) new_config['TORRENT']['tor_downloader_utorrent'] = int(TOR_DOWNLOADER_UTORRENT) new_config['TORRENT']['tor_downloader_transmission'] = int(TOR_DOWNLOADER_TRANSMISSION) new_config['TORRENT']['tor_downloader_deluge'] = int(TOR_DOWNLOADER_DELUGE) new_config['TORRENT']['numberofseeders'] = int(NUMBEROFSEEDERS) new_config['TORRENT']['torrent_dir'] = TORRENT_DIR new_config['UTORRENT'] = {} new_config['UTORRENT']['utorrent_host'] = UTORRENT_HOST new_config['UTORRENT']['utorrent_user'] = UTORRENT_USER new_config['UTORRENT']['utorrent_pass'] = UTORRENT_PASS new_config['UTORRENT']['utorrent_label'] = UTORRENT_LABEL new_config['TRANSMISSION'] = {} new_config['TRANSMISSION']['transmission_host'] = TRANSMISSION_HOST new_config['TRANSMISSION']['transmission_user'] = TRANSMISSION_USER new_config['TRANSMISSION']['transmission_pass'] = TRANSMISSION_PASS new_config['DELUGE'] = {} new_config['DELUGE']['deluge_host'] = DELUGE_HOST new_config['DELUGE']['deluge_port'] = DELUGE_PORT new_config['DELUGE']['deluge_user'] = DELUGE_USER new_config['DELUGE']['deluge_pass'] = DELUGE_PASS new_config['KAT'] = {} new_config['KAT']['kat'] = int(KAT) new_config['KAT']['kat_host'] = KAT_HOST new_config['SearchScan'] = {} new_config['SearchScan']['search_interval'] = int(SEARCH_INTERVAL) new_config['SearchScan']['scan_interval'] = int(SCAN_INTERVAL) new_config['SearchScan']['versioncheck_interval'] = int(VERSIONCHECK_INTERVAL) new_config['LibraryScan'] = {} new_config['LibraryScan']['full_scan'] = int(FULL_SCAN) new_config['LibraryScan']['add_author'] = int(ADD_AUTHOR) new_config['LibraryScan']['notfound_status'] = NOTFOUND_STATUS new_config['LibraryScan']['newbook_status'] = NEWBOOK_STATUS new_config['PostProcess'] = {} new_config['PostProcess']['ebook_dest_folder'] = EBOOK_DEST_FOLDER new_config['PostProcess']['ebook_dest_file'] = EBOOK_DEST_FILE new_config['PostProcess']['mag_dest_folder'] = MAG_DEST_FOLDER new_config['PostProcess']['mag_dest_file'] = MAG_DEST_FILE new_config['PostProcess']['mag_relative'] = int(MAG_RELATIVE) 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_username'] = TWITTER_USERNAME new_config['Twitter']['twitter_password'] = TWITTER_PASSWORD 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_token'] = BOXCAR_TOKEN 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_token'] = PUSHBULLET_TOKEN new_config['Pushbullet']['pushbullet_deviceid'] = PUSHBULLET_DEVICEID new_config['Pushover'] = {} new_config['Pushover']['use_pushover'] = int(USE_PUSHOVER) new_config['Pushover']['pushover_onsnatch'] = int(PUSHOVER_ONSNATCH) new_config['Pushover']['pushover_ondownload'] = int(PUSHOVER_ONDOWNLOAD) new_config['Pushover']['pushover_priority'] = int(PUSHOVER_PRIORITY) new_config['Pushover']['pushover_keys'] = PUSHOVER_KEYS new_config['Pushover']['pushover_apitoken'] = PUSHOVER_APITOKEN new_config['AndroidPN'] = {} new_config['AndroidPN']['use_androidpn'] = int(USE_ANDROIDPN) new_config['AndroidPN']['androidpn_notify_onsnatch'] = int(ANDROIDPN_NOTIFY_ONSNATCH) new_config['AndroidPN']['androidpn_notify_ondownload'] = int(ANDROIDPN_NOTIFY_ONDOWNLOAD) new_config['AndroidPN']['androidpn_url'] = ANDROIDPN_URL new_config['AndroidPN']['androidpn_username'] = ANDROIDPN_USERNAME new_config['AndroidPN']['androidpn_broadcast'] = ANDROIDPN_BROADCAST new_config['NMA'] = {} new_config['NMA']['nma_enabled'] = int(NMA_ENABLED) new_config['NMA']['nma_apikey'] = NMA_APIKEY new_config['NMA']['nma_priority'] = NMA_PRIORITY new_config['NMA']['nma_onsnatch'] = int(NMA_ONSNATCH) new_config.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_username'] = HTTP_USERNAME new_config['General']['http_password'] = HTTP_PASSWORD new_config['General']['http_root'] = HTTP_ROOT new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['log_dir'] = LOG_DIR new_config['General']['git_path'] = GIT_PATH new_config['General']['music_dir'] = MUSIC_DIR new_config['General']['destination_dir'] = DESTINATION_DIR new_config['General']['preferred_quality'] = PREFERRED_QUALITY new_config['General']['preferred_bitrate'] = PREFERRED_BITRATE new_config['General']['detect_bitrate'] = int(DETECT_BITRATE) new_config['General']['auto_add_artists'] = int(ADD_ARTISTS) new_config['General']['correct_metadata'] = int(CORRECT_METADATA) new_config['General']['move_files'] = int(MOVE_FILES) new_config['General']['rename_files'] = int(RENAME_FILES) new_config['General']['folder_format'] = FOLDER_FORMAT new_config['General']['file_format'] = FILE_FORMAT new_config['General']['cleanup_files'] = int(CLEANUP_FILES) new_config['General']['add_album_art'] = int(ADD_ALBUM_ART) new_config['General']['embed_album_art'] = int(EMBED_ALBUM_ART) new_config['General']['embed_lyrics'] = int(EMBED_LYRICS) new_config['General']['download_dir'] = DOWNLOAD_DIR new_config['General']['blackhole'] = int(BLACKHOLE) new_config['General']['blackhole_dir'] = BLACKHOLE_DIR new_config['General']['usenet_retention'] = USENET_RETENTION new_config['General']['include_extras'] = int(INCLUDE_EXTRAS) new_config['General']['numberofseeders'] = NUMBEROFSEEDERS new_config['General']['torrentblackhole_dir'] = TORRENTBLACKHOLE_DIR new_config['General']['isohunt'] = int(ISOHUNT) new_config['General']['kat'] = int(KAT) new_config['General']['mininova'] = int(MININOVA) new_config['General']['download_torrent_dir'] = DOWNLOAD_TORRENT_DIR new_config['General']['search_interval'] = SEARCH_INTERVAL new_config['General']['libraryscan_interval'] = LIBRARYSCAN_INTERVAL new_config['General']['download_scan_interval'] = DOWNLOAD_SCAN_INTERVAL new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_username'] = SAB_USERNAME new_config['SABnzbd']['sab_password'] = SAB_PASSWORD new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY new_config['SABnzbd']['sab_category'] = SAB_CATEGORY new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_username'] = NZBMATRIX_USERNAME new_config['NZBMatrix']['nzbmatrix_apikey'] = NZBMATRIX_APIKEY new_config['Newznab'] = {} new_config['Newznab']['newznab'] = int(NEWZNAB) new_config['Newznab']['newznab_host'] = NEWZNAB_HOST new_config['Newznab']['newznab_apikey'] = NEWZNAB_APIKEY new_config['NZBsorg'] = {} new_config['NZBsorg']['nzbsorg'] = int(NZBSORG) new_config['NZBsorg']['nzbsorg_uid'] = NZBSORG_UID new_config['NZBsorg']['nzbsorg_hash'] = NZBSORG_HASH new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_uid'] = NEWZBIN_UID new_config['Newzbin']['newzbin_password'] = NEWZBIN_PASSWORD new_config['General']['lastfm_username'] = LASTFM_USERNAME new_config['General']['interface'] = INTERFACE new_config['General']['folder_permissions'] = FOLDER_PERMISSIONS new_config['General']['encode'] = int(ENCODE) new_config['General']['encoder'] = ENCODER new_config['General']['bitrate'] = int(BITRATE) new_config['General']['samplingfrequency'] = int(SAMPLINGFREQUENCY) new_config['General']['encoderfolder'] = ENCODERFOLDER new_config['General']['advancedencoder'] = ADVANCEDENCODER new_config['General']['encoderoutputformat'] = ENCODEROUTPUTFORMAT new_config['General']['encoderquality'] = ENCODERQUALITY new_config['General']['encodervbrcbr'] = ENCODERVBRCBR new_config['General']['encoderlossless'] = ENCODERLOSSLESS new_config.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['config_version'] = CONFIG_VERSION new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_username'] = HTTP_USERNAME new_config['General']['http_password'] = HTTP_PASSWORD new_config['General']['http_root'] = HTTP_ROOT new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['log_dir'] = LOG_DIR new_config['General']['git_path'] = GIT_PATH new_config['General']['check_github'] = int(CHECK_GITHUB) new_config['General']['check_github_on_startup'] = int(CHECK_GITHUB_ON_STARTUP) new_config['General']['check_github_interval'] = CHECK_GITHUB_INTERVAL new_config['General']['destination_dir'] = DESTINATION_DIR new_config['General']['usenet_retention'] = USENET_RETENTION new_config['General']['search_interval'] = SEARCH_INTERVAL new_config['General']['libraryscan_interval'] = LIBRARYSCAN_INTERVAL new_config['General']['download_scan_interval'] = DOWNLOAD_SCAN_INTERVAL new_config['General']['interface'] = INTERFACE new_config['General']['autowant_all'] = AUTOWANT_ALL new_config['General']['autowant_upcoming'] = AUTOWANT_UPCOMING new_config['General']['preferred_quality'] = PREFERRED_QUALITY new_config['General']['correct_metadata'] = int(CORRECT_METADATA) new_config['General']['move_files'] = int(MOVE_FILES) new_config['General']['rename_files'] = int(RENAME_FILES) new_config['General']['folder_format'] = FOLDER_FORMAT new_config['General']['file_format'] = FILE_FORMAT new_config['General']['blackhole'] = int(BLACKHOLE) new_config['General']['blackhole_dir'] = BLACKHOLE_DIR new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_username'] = SAB_USERNAME new_config['SABnzbd']['sab_password'] = SAB_PASSWORD new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY new_config['SABnzbd']['sab_category'] = SAB_CATEGORY new_config['NZBsu'] = {} new_config['NZBsu']['nzbsu'] = int(NZBSU) new_config['NZBsu']['nzbsu_apikey'] = NZBSU_APIKEY new_config['DOGnzb'] = {} new_config['DOGnzb']['dognzb'] = int(DOGNZB) new_config['DOGnzb']['dognzb_apikey'] = DOGNZB_APIKEY new_config['Experimental'] = {} new_config['Experimental']['experimental'] = int(EXPERIMENTAL) new_config['Raw'] = {} new_config['Raw']['raw'] = int(RAW) new_config['Raw']['raw_provider'] = RAW_PROVIDER new_config['Raw']['raw_username'] = RAW_USERNAME new_config['Raw']['raw_password'] = RAW_PASSWORD new_config['Raw']['raw_groups'] = RAW_GROUPS new_config.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIG_FILE print ("falalal") new_config["General"] = {} new_config["General"]["config_version"] = CONFIG_VERSION new_config["General"]["http_port"] = HTTP_PORT new_config["General"]["http_host"] = HTTP_HOST new_config["General"]["http_username"] = HTTP_USERNAME new_config["General"]["http_password"] = HTTP_PASSWORD new_config["General"]["http_root"] = HTTP_ROOT new_config["General"]["launch_browser"] = int(LAUNCH_BROWSER) new_config["General"]["log_dir"] = LOG_DIR new_config["General"]["logverbose"] = int(LOGVERBOSE) new_config["General"]["git_path"] = GIT_PATH new_config["General"]["check_github"] = int(CHECK_GITHUB) new_config["General"]["check_github_on_startup"] = int(CHECK_GITHUB_ON_STARTUP) new_config["General"]["check_github_interval"] = CHECK_GITHUB_INTERVAL new_config["General"]["destination_dir"] = DESTINATION_DIR new_config["General"]["usenet_retention"] = USENET_RETENTION new_config["General"]["search_interval"] = SEARCH_INTERVAL new_config["General"]["libraryscan_interval"] = LIBRARYSCAN_INTERVAL new_config["General"]["download_scan_interval"] = DOWNLOAD_SCAN_INTERVAL new_config["General"]["interface"] = INTERFACE new_config["General"]["autowant_all"] = AUTOWANT_ALL new_config["General"]["autowant_upcoming"] = AUTOWANT_UPCOMING new_config["General"]["preferred_quality"] = PREFERRED_QUALITY new_config["General"]["comic_cover_local"] = COMIC_COVER_LOCAL new_config["General"]["correct_metadata"] = int(CORRECT_METADATA) new_config["General"]["move_files"] = int(MOVE_FILES) new_config["General"]["rename_files"] = int(RENAME_FILES) new_config["General"]["folder_format"] = FOLDER_FORMAT new_config["General"]["file_format"] = FILE_FORMAT new_config["General"]["blackhole"] = int(BLACKHOLE) new_config["General"]["blackhole_dir"] = BLACKHOLE_DIR new_config["General"]["replace_spaces"] = int(REPLACE_SPACES) new_config["General"]["replace_char"] = REPLACE_CHAR new_config["General"]["zero_level"] = int(ZERO_LEVEL) new_config["General"]["zero_level_n"] = ZERO_LEVEL_N new_config["General"]["use_minsize"] = int(USE_MINSIZE) new_config["General"]["minsize"] = MINSIZE new_config["General"]["use_maxsize"] = int(USE_MAXSIZE) new_config["General"]["maxsize"] = MAXSIZE new_config["General"]["enable_extra_scripts"] = int(ENABLE_EXTRA_SCRIPTS) new_config["General"]["extra_scripts"] = EXTRA_SCRIPTS new_config["General"]["enable_pre_scripts"] = int(ENABLE_PRE_SCRIPTS) new_config["General"]["pre_scripts"] = PRE_SCRIPTS new_config["SABnzbd"] = {} new_config["SABnzbd"]["sab_host"] = SAB_HOST new_config["SABnzbd"]["sab_username"] = SAB_USERNAME new_config["SABnzbd"]["sab_password"] = SAB_PASSWORD new_config["SABnzbd"]["sab_apikey"] = SAB_APIKEY new_config["SABnzbd"]["sab_category"] = SAB_CATEGORY new_config["SABnzbd"]["sab_priority"] = SAB_PRIORITY new_config["NZBsu"] = {} new_config["NZBsu"]["nzbsu"] = int(NZBSU) new_config["NZBsu"]["nzbsu_apikey"] = NZBSU_APIKEY new_config["DOGnzb"] = {} new_config["DOGnzb"]["dognzb"] = int(DOGNZB) new_config["DOGnzb"]["dognzb_apikey"] = DOGNZB_APIKEY new_config["nzbx"] = {} new_config["nzbx"]["nzbx"] = int(NZBX) new_config["Experimental"] = {} new_config["Experimental"]["experimental"] = int(EXPERIMENTAL) new_config["Newznab"] = {} new_config["Newznab"]["newznab"] = int(NEWZNAB) new_config["Newznab"]["newznab_host"] = NEWZNAB_HOST new_config["Newznab"]["newznab_apikey"] = NEWZNAB_APIKEY new_config["Newznab"]["newznab_enabled"] = int(NEWZNAB_ENABLED) # Need to unpack the extra newznabs for saving in config.ini flattened_newznabs = [] for newznab in EXTRA_NEWZNABS: for item in newznab: flattened_newznabs.append(item) new_config["Newznab"]["extra_newznabs"] = flattened_newznabs new_config["Raw"] = {} new_config["Raw"]["raw"] = int(RAW) new_config["Raw"]["raw_provider"] = RAW_PROVIDER new_config["Raw"]["raw_username"] = RAW_USERNAME new_config["Raw"]["raw_password"] = RAW_PASSWORD new_config["Raw"]["raw_groups"] = RAW_GROUPS new_config.write()
def save_config(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['config_version'] = CONFIG_VERSION new_config['General']['log_dir'] = ACTUAL_LOG_DIR if ACTUAL_LOG_DIR else 'Logs' 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'] = WEB_PASSWORD new_config['General']['anon_redirect'] = ANON_REDIRECT new_config['General']['use_api'] = int(USE_API) new_config['General']['api_key'] = API_KEY new_config['General']['enable_https'] = int(ENABLE_HTTPS) new_config['General']['https_cert'] = HTTPS_CERT new_config['General']['https_key'] = HTTPS_KEY 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']['usenet_retention'] = int(USENET_RETENTION) new_config['General']['search_frequency'] = int(SEARCH_FREQUENCY) new_config['General']['download_propers'] = int(DOWNLOAD_PROPERS) 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) new_config['General']['provider_order'] = ' '.join(PROVIDER_ORDER) new_config['General']['version_notify'] = int(VERSION_NOTIFY) 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 new_config['General']['naming_multi_ep'] = int(NAMING_MULTI_EP) new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) 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 new_config['General']['metadata_mede8er'] = METADATA_MEDE8ER 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']['move_associated_files'] = int(MOVE_ASSOCIATED_FILES) new_config['General']['process_automatically'] = int(PROCESS_AUTOMATICALLY) new_config['General']['rename_episodes'] = int(RENAME_EPISODES) 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['Blackhole'] = {} new_config['Blackhole']['nzb_dir'] = NZB_DIR new_config['Blackhole']['torrent_dir'] = TORRENT_DIR new_config['EZRSS'] = {} new_config['EZRSS']['ezrss'] = int(EZRSS) new_config['HDBITS'] = {} new_config['HDBITS']['hdbits'] = int(HDBITS) new_config['HDBITS']['hdbits_username'] = HDBITS_USERNAME new_config['HDBITS']['hdbits_passkey'] = HDBITS_PASSKEY new_config['TVTORRENTS'] = {} new_config['TVTORRENTS']['tvtorrents'] = int(TVTORRENTS) new_config['TVTORRENTS']['tvtorrents_digest'] = TVTORRENTS_DIGEST new_config['TVTORRENTS']['tvtorrents_hash'] = TVTORRENTS_HASH new_config['BTN'] = {} new_config['BTN']['btn'] = int(BTN) new_config['BTN']['btn_api_key'] = BTN_API_KEY new_config['TorrentLeech'] = {} new_config['TorrentLeech']['torrentleech'] = int(TORRENTLEECH) new_config['TorrentLeech']['torrentleech_key'] = TORRENTLEECH_KEY 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['Womble'] = {} new_config['Womble']['womble'] = int(WOMBLE) new_config['omgwtfnzbs'] = {} new_config['omgwtfnzbs']['omgwtfnzbs'] = int(OMGWTFNZBS) new_config['omgwtfnzbs']['omgwtfnzbs_username'] = OMGWTFNZBS_USERNAME new_config['omgwtfnzbs']['omgwtfnzbs_apikey'] = OMGWTFNZBS_APIKEY new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_username'] = SAB_USERNAME new_config['SABnzbd']['sab_password'] = SAB_PASSWORD new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY new_config['SABnzbd']['sab_category'] = SAB_CATEGORY new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['NZBget'] = {} new_config['NZBget']['nzbget_username'] = NZBGET_USERNAME new_config['NZBget']['nzbget_password'] = NZBGET_PASSWORD new_config['NZBget']['nzbget_category'] = NZBGET_CATEGORY new_config['NZBget']['nzbget_host'] = NZBGET_HOST new_config['XBMC'] = {} new_config['XBMC']['use_xbmc'] = int(USE_XBMC) new_config['XBMC']['xbmc_always_on'] = int(XBMC_ALWAYS_ON) new_config['XBMC']['xbmc_notify_onsnatch'] = int(XBMC_NOTIFY_ONSNATCH) new_config['XBMC']['xbmc_notify_ondownload'] = int(XBMC_NOTIFY_ONDOWNLOAD) 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'] = XBMC_PASSWORD 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_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'] = PLEX_PASSWORD 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_host'] = GROWL_HOST new_config['Growl']['growl_password'] = GROWL_PASSWORD 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_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_username'] = TWITTER_USERNAME new_config['Twitter']['twitter_password'] = TWITTER_PASSWORD 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_username'] = BOXCAR_USERNAME 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_userkey'] = PUSHOVER_USERKEY 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['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['Synology'] = {} new_config['Synology']['use_synoindex'] = int(USE_SYNOINDEX) 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['Trakt'] = {} new_config['Trakt']['use_trakt'] = int(USE_TRAKT) new_config['Trakt']['trakt_username'] = TRAKT_USERNAME new_config['Trakt']['trakt_password'] = TRAKT_PASSWORD new_config['Trakt']['trakt_api'] = TRAKT_API 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_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_api'] = NMA_API new_config['NMA']['nma_priority'] = NMA_PRIORITY new_config['Newznab'] = {} new_config['Newznab']['newznab_data'] = NEWZNAB_DATA new_config['GUI'] = {} 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.write()
def save_config(): new_config = ConfigObj() new_config.filename = CONFIG_FILE # 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'] = {} 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) new_config['General']['localhost_ip'] = LOCALHOST_IP new_config['General']['cpu_preset'] = CPU_PRESET new_config['General']['anon_redirect'] = ANON_REDIRECT new_config['General']['use_api'] = int(USE_API) new_config['General']['api_key'] = API_KEY new_config['General']['debug'] = int(DEBUG) new_config['General']['handle_reverse_proxy'] = int(HANDLE_REVERSE_PROXY) new_config['General']['update_frequency'] = int(UPDATE_FREQUENCY) new_config['General']['version_notify'] = int(VERSION_NOTIFY) new_config['General']['auto_update'] = int(AUTO_UPDATE) new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['proxy_setting'] = PROXY_SETTING new_config['General']['use_listview'] = int(USE_LISTVIEW) new_config['General']['extra_scripts'] = '|'.join(EXTRA_SCRIPTS) new_config['General']['git_path'] = GIT_PATH 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_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['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_accesstoken'] = BOXCAR2_ACCESSTOKEN 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) new_config['Trakt']['trakt_use_watchlist'] = int(TRAKT_USE_WATCHLIST) new_config['Trakt']['trakt_method_add'] = TRAKT_METHOD_ADD new_config['Trakt']['trakt_start_paused'] = int(TRAKT_START_PAUSED) new_config['Trakt']['trakt_use_recommended'] = int(TRAKT_USE_RECOMMENDED) new_config['Trakt']['trakt_sync'] = int(TRAKT_SYNC) new_config['GUI'] = {} new_config['GUI']['gui_name'] = GUI_NAME new_config['GUI']['fuzzy_dating'] = int(FUZZY_DATING) new_config['GUI']['trim_zero'] = int(TRIM_ZERO) new_config['GUI']['date_preset'] = DATE_PRESET new_config['GUI']['time_preset'] = TIME_PRESET_W_SECONDS new_config['GUI']['timezone_display'] = TIMEZONE_DISPLAY new_config['EventGhost'] = {} new_config['EventGhost']['eventghost_plex'] = int(USE_PLEX) new_config['EventGhost']['eventghost_server_host'] = PLEX_SERVER_HOST new_config['EventGhost']['eventghost_host'] = PLEX_HOST new_config['Drives'] = {} new_config['Drives']['use_drives'] = int(USE_DRIVES) new_config['Drives']['use_driveA'] = int(USE_DRIVEA) new_config['Drives']['use_driveB'] = int(USE_DRIVEB) new_config['Drives']['use_driveC'] = int(USE_DRIVEC) new_config['Drives']['driveA_name'] = DRIVEA_NAME new_config['Drives']['driveB_name'] = DRIVEB_NAME new_config['Drives']['driveC_name'] = DRIVEC_NAME new_config['Sickbeard'] = {} new_config['Sickbeard']['use_sickbeard'] = int(USE_SICKBEARD) new_config['Sickbeard']['sickbeard_host'] = SICKBEARD_HOST new_config['Sickbeard']['sickbeard_api'] = SICKBEARD_API new_config['Speedfan'] = {} new_config['Speedfan']['use_speedfan'] = int(USE_SPEEDFAN) new_config['Speedfan']['speedfan_log_location'] = SPEEDFAN_LOG_LOCATION new_config.write()
def save_config(): new_config = ConfigObj() new_config.filename = CONFIG_FILE new_config['General'] = {} new_config['General']['log_dir'] = LOG_DIR 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'] = WEB_PASSWORD new_config['General']['use_api'] = int(USE_API) new_config['General']['api_key'] = API_KEY 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']['usenet_retention'] = int(USENET_RETENTION) new_config['General']['search_frequency'] = int(SEARCH_FREQUENCY) new_config['General']['download_propers'] = int(DOWNLOAD_PROPERS) new_config['General']['quality_default'] = int(QUALITY_DEFAULT) new_config['General']['status_default'] = int(STATUS_DEFAULT) new_config['General']['season_folders_format'] = SEASON_FOLDERS_FORMAT new_config['General']['season_folders_default'] = int(SEASON_FOLDERS_DEFAULT) new_config['General']['provider_order'] = ' '.join([x.getID() for x in providers.sortedProviderList()]) new_config['General']['version_notify'] = int(VERSION_NOTIFY) new_config['General']['naming_ep_name'] = int(NAMING_EP_NAME) new_config['General']['naming_show_name'] = int(NAMING_SHOW_NAME) new_config['General']['naming_ep_type'] = int(NAMING_EP_TYPE) new_config['General']['naming_multi_ep_type'] = int(NAMING_MULTI_EP_TYPE) new_config['General']['naming_sep_type'] = int(NAMING_SEP_TYPE) new_config['General']['naming_use_periods'] = int(NAMING_USE_PERIODS) new_config['General']['naming_quality'] = int(NAMING_QUALITY) new_config['General']['naming_dates'] = int(NAMING_DATES) new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['use_banner'] = int(USE_BANNER) new_config['General']['use_listview'] = int(USE_LISTVIEW) new_config['General']['metadata_xbmc'] = metadata_provider_dict['XBMC'].get_config() new_config['General']['metadata_mediabrowser'] = metadata_provider_dict['MediaBrowser'].get_config() new_config['General']['metadata_ps3'] = metadata_provider_dict['Sony PS3'].get_config() new_config['General']['metadata_wdtv'] = metadata_provider_dict['WDTV'].get_config() new_config['General']['metadata_tivo'] = metadata_provider_dict['TIVO'].get_config() 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']['move_associated_files'] = int(MOVE_ASSOCIATED_FILES) new_config['General']['process_automatically'] = int(PROCESS_AUTOMATICALLY) new_config['General']['rename_episodes'] = int(RENAME_EPISODES) new_config['General']['extra_scripts'] = '|'.join(EXTRA_SCRIPTS) new_config['General']['git_path'] = GIT_PATH new_config['General']['ignore_words'] = IGNORE_WORDS new_config['Blackhole'] = {} new_config['Blackhole']['nzb_dir'] = NZB_DIR new_config['Blackhole']['torrent_dir'] = TORRENT_DIR new_config['EZRSS'] = {} new_config['EZRSS']['ezrss'] = int(EZRSS) new_config['TVTORRENTS'] = {} new_config['TVTORRENTS']['tvtorrents'] = int(TVTORRENTS) new_config['TVTORRENTS']['tvtorrents_digest'] = TVTORRENTS_DIGEST new_config['TVTORRENTS']['tvtorrents_hash'] = TVTORRENTS_HASH 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['NZBsRUS'] = {} new_config['NZBsRUS']['nzbsrus'] = int(NZBSRUS) new_config['NZBsRUS']['nzbsrus_uid'] = NZBSRUS_UID new_config['NZBsRUS']['nzbsrus_hash'] = NZBSRUS_HASH new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_username'] = NZBMATRIX_USERNAME new_config['NZBMatrix']['nzbmatrix_apikey'] = NZBMATRIX_APIKEY new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_username'] = NEWZBIN_USERNAME new_config['Newzbin']['newzbin_password'] = NEWZBIN_PASSWORD new_config['Womble'] = {} new_config['Womble']['womble'] = int(WOMBLE) new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_username'] = SAB_USERNAME new_config['SABnzbd']['sab_password'] = SAB_PASSWORD new_config['SABnzbd']['sab_apikey'] = SAB_APIKEY new_config['SABnzbd']['sab_category'] = SAB_CATEGORY new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['NZBget'] = {} new_config['NZBget']['nzbget_password'] = NZBGET_PASSWORD new_config['NZBget']['nzbget_category'] = NZBGET_CATEGORY new_config['NZBget']['nzbget_host'] = NZBGET_HOST new_config['XBMC'] = {} new_config['XBMC']['use_xbmc'] = int(USE_XBMC) new_config['XBMC']['xbmc_notify_onsnatch'] = int(XBMC_NOTIFY_ONSNATCH) new_config['XBMC']['xbmc_notify_ondownload'] = int(XBMC_NOTIFY_ONDOWNLOAD) new_config['XBMC']['xbmc_update_library'] = int(XBMC_UPDATE_LIBRARY) new_config['XBMC']['xbmc_update_full'] = int(XBMC_UPDATE_FULL) new_config['XBMC']['xbmc_host'] = XBMC_HOST new_config['XBMC']['xbmc_username'] = XBMC_USERNAME new_config['XBMC']['xbmc_password'] = XBMC_PASSWORD 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_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'] = PLEX_PASSWORD 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_host'] = GROWL_HOST new_config['Growl']['growl_password'] = GROWL_PASSWORD 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_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_username'] = TWITTER_USERNAME new_config['Twitter']['twitter_password'] = TWITTER_PASSWORD new_config['Twitter']['twitter_prefix'] = TWITTER_PREFIX new_config['Notifo'] = {} new_config['Notifo']['use_notifo'] = int(USE_NOTIFO) new_config['Notifo']['notifo_notify_onsnatch'] = int(NOTIFO_NOTIFY_ONSNATCH) new_config['Notifo']['notifo_notify_ondownload'] = int(NOTIFO_NOTIFY_ONDOWNLOAD) new_config['Notifo']['notifo_username'] = NOTIFO_USERNAME new_config['Notifo']['notifo_apisecret'] = NOTIFO_APISECRET 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_username'] = BOXCAR_USERNAME 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['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['Synology'] = {} new_config['Synology']['use_synoindex'] = int(USE_SYNOINDEX) new_config['Trakt'] = {} new_config['Trakt']['use_trakt'] = int(USE_TRAKT) new_config['Trakt']['trakt_username'] = TRAKT_USERNAME new_config['Trakt']['trakt_password'] = TRAKT_PASSWORD new_config['Trakt']['trakt_api'] = TRAKT_API 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_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['Newznab'] = {} new_config['Newznab']['newznab_data'] = '!!!'.join([x.configStr() for x in newznabProviderList]) new_config['GUI'] = {} 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.write()
def config_write(): new_config = ConfigObj() new_config.filename = CONFIGFILE new_config['General'] = {} new_config['General']['http_port'] = HTTP_PORT new_config['General']['http_host'] = HTTP_HOST new_config['General']['http_user'] = HTTP_USER new_config['General']['http_pass'] = HTTP_PASS new_config['General']['http_root'] = HTTP_ROOT new_config['General']['http_look'] = HTTP_LOOK new_config['General']['launch_browser'] = int(LAUNCH_BROWSER) new_config['General']['logdir'] = LOGDIR new_config['General']['imp_onlyisbn'] = int(IMP_ONLYISBN) new_config['General']['imp_preflang'] = IMP_PREFLANG new_config['SABnzbd'] = {} new_config['SABnzbd']['sab_host'] = SAB_HOST new_config['SABnzbd']['sab_port'] = SAB_PORT new_config['SABnzbd']['sab_user'] = SAB_USER new_config['SABnzbd']['sab_pass'] = SAB_PASS new_config['SABnzbd']['sab_api'] = SAB_API new_config['SABnzbd']['sab_cat'] = SAB_CAT new_config['General']['destination_dir'] = DESTINATION_DIR new_config['General']['destination_copy'] = int(DESTINATION_COPY) new_config['General']['download_dir'] = DOWNLOAD_DIR new_config['General']['blackhole'] = int(BLACKHOLE) new_config['General']['blackholedir'] = BLACKHOLEDIR new_config['General']['usenet_retention'] = USENET_RETENTION new_config['NZBMatrix'] = {} new_config['NZBMatrix']['nzbmatrix'] = int(NZBMATRIX) new_config['NZBMatrix']['nzbmatrix_user'] = NZBMATRIX_USER new_config['NZBMatrix']['nzbmatrix_api'] = NZBMATRIX_API new_config['Newznab'] = {} new_config['Newznab']['newznab'] = int(NEWZNAB) new_config['Newznab']['newznab_host'] = NEWZNAB_HOST new_config['Newznab']['newznab_api'] = NEWZNAB_API new_config['Newzbin'] = {} new_config['Newzbin']['newzbin'] = int(NEWZBIN) new_config['Newzbin']['newzbin_uid'] = NEWZBIN_UID new_config['Newzbin']['newzbin_pass'] = NEWZBIN_PASS new_config['SearchScan'] = {} new_config['SearchScan']['search_interval'] = SEARCH_INTERVAL new_config['SearchScan']['scan_interval'] = SCAN_INTERVAL new_config['PostProcess'] = {} new_config['PostProcess']['ebook_dest_folder'] = EBOOK_DEST_FOLDER new_config['PostProcess']['ebook_dest_file'] = EBOOK_DEST_FILE new_config['PostProcess']['mag_dest_folder'] = MAG_DEST_FOLDER new_config['PostProcess']['mag_dest_file'] = MAG_DEST_FILE 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_username'] = TWITTER_USERNAME new_config['Twitter']['twitter_password'] = TWITTER_PASSWORD new_config['Twitter']['twitter_prefix'] = TWITTER_PREFIX new_config.write()