Merge branch 'master' of github.com:OpenELEC/OpenELEC.tv

This commit is contained in:
Stephan Raue 2012-06-21 12:57:38 +02:00
commit d1da488ea1
5 changed files with 278 additions and 241 deletions

View File

@ -5,6 +5,7 @@
<setting id="SABNZBD_KEEP_AWAKE" value="false" /> <setting id="SABNZBD_KEEP_AWAKE" value="false" />
<setting id="SABNZBD_PERIODIC_WAKE" value="false" /> <setting id="SABNZBD_PERIODIC_WAKE" value="false" />
<setting id="SABNZBD_WAKE_AT" value="1" /> <setting id="SABNZBD_WAKE_AT" value="1" />
<setting id="SABNZBD_LAUNCH" value="true" />
<setting id="SICKBEARD_LAUNCH" value="true" /> <setting id="SICKBEARD_LAUNCH" value="true" />
<setting id="COUCHPOTATO_LAUNCH" value="true" /> <setting id="COUCHPOTATO_LAUNCH" value="true" />
<setting id="COUCHPOTATO_VERSION" value="0" /> <setting id="COUCHPOTATO_VERSION" value="0" />

View File

@ -30,6 +30,7 @@ import hashlib
from configobj import ConfigObj from configobj import ConfigObj
from xml.dom.minidom import parseString from xml.dom.minidom import parseString
import logging import logging
import traceback
logging.basicConfig(filename='/var/log/sabnzbd-suite.log', logging.basicConfig(filename='/var/log/sabnzbd-suite.log',
filemode='w', filemode='w',
@ -138,6 +139,7 @@ user = getAddonSetting(suiteSettings, 'SABNZBD_USER')
pwd = getAddonSetting(suiteSettings, 'SABNZBD_PWD') pwd = getAddonSetting(suiteSettings, 'SABNZBD_PWD')
host = getAddonSetting(suiteSettings, 'SABNZBD_IP') host = getAddonSetting(suiteSettings, 'SABNZBD_IP')
sabNzbdKeepAwake = getAddonSetting(suiteSettings, 'SABNZBD_KEEP_AWAKE') sabNzbdKeepAwake = getAddonSetting(suiteSettings, 'SABNZBD_KEEP_AWAKE')
sabnzbd_launch = getAddonSetting(suiteSettings, 'SABNZBD_LAUNCH')
sickbeard_launch = getAddonSetting(suiteSettings, 'SICKBEARD_LAUNCH') sickbeard_launch = getAddonSetting(suiteSettings, 'SICKBEARD_LAUNCH')
couchpotato_launch = getAddonSetting(suiteSettings, 'COUCHPOTATO_LAUNCH') couchpotato_launch = getAddonSetting(suiteSettings, 'COUCHPOTATO_LAUNCH')
couchpotato_version = getAddonSetting(suiteSettings, 'COUCHPOTATO_VERSION') couchpotato_version = getAddonSetting(suiteSettings, 'COUCHPOTATO_VERSION')
@ -148,6 +150,8 @@ fDefaultSuiteSettings = open(pDefaultSuiteSettings, 'r')
data = fDefaultSuiteSettings.read() data = fDefaultSuiteSettings.read()
fDefaultSuiteSettings.close fDefaultSuiteSettings.close
DefaultSuiteSettings = parseString(data) DefaultSuiteSettings = parseString(data)
if not sabnzbd_launch:
sabnzbd_launch = getAddonSetting(DefaultSuiteSettings, 'SABNZBD_LAUNCH')
if not sickbeard_launch: if not sickbeard_launch:
sickbeard_launch = getAddonSetting(DefaultSuiteSettings, 'SICKBEARD_LAUNCH') sickbeard_launch = getAddonSetting(DefaultSuiteSettings, 'SICKBEARD_LAUNCH')
if not couchpotato_launch: if not couchpotato_launch:
@ -179,265 +183,295 @@ except:
signal.signal(signal.SIGCHLD, signal.SIG_DFL) signal.signal(signal.SIGCHLD, signal.SIG_DFL)
os.environ['PYTHONPATH'] = str(os.environ.get('PYTHONPATH')) + ':' + pPylib os.environ['PYTHONPATH'] = str(os.environ.get('PYTHONPATH')) + ':' + pPylib
# write SABnzbd settings # SABnzbd start
# ---------------------- try:
# write SABnzbd settings
# ----------------------
sabNzbdConfig = ConfigObj(pSabNzbdSettings,create_empty=True)
defaultConfig = ConfigObj()
defaultConfig['misc'] = {}
defaultConfig['misc']['disable_api_key'] = '0'
defaultConfig['misc']['check_new_rel'] = '0'
defaultConfig['misc']['auto_browser'] = '0'
defaultConfig['misc']['username'] = user
defaultConfig['misc']['password'] = pwd
defaultConfig['misc']['port'] = '8081'
defaultConfig['misc']['https_port'] = '9081'
defaultConfig['misc']['https_cert'] = 'server.cert'
defaultConfig['misc']['https_key'] = 'server.key'
defaultConfig['misc']['host'] = host
defaultConfig['misc']['web_dir'] = 'Plush'
defaultConfig['misc']['web_dir2'] = 'Plush'
defaultConfig['misc']['web_color'] = 'gold'
defaultConfig['misc']['web_color2'] = 'gold'
defaultConfig['misc']['log_dir'] = 'logs'
defaultConfig['misc']['admin_dir'] = 'admin'
defaultConfig['misc']['nzb_backup_dir'] = 'backup'
defaultConfig['misc']['script_dir'] = 'scripts'
sabNzbdConfig = ConfigObj(pSabNzbdSettings,create_empty=True) if firstLaunch:
defaultConfig = ConfigObj() defaultConfig['misc']['download_dir'] = pSabNzbdIncomplete
defaultConfig['misc'] = {} defaultConfig['misc']['complete_dir'] = pSabNzbdComplete
defaultConfig['misc']['disable_api_key'] = '0' servers = {}
defaultConfig['misc']['check_new_rel'] = '0' servers['localhost'] = {}
defaultConfig['misc']['auto_browser'] = '0' servers['localhost']['host'] = 'localhost'
defaultConfig['misc']['username'] = user servers['localhost']['port'] = '119'
defaultConfig['misc']['password'] = pwd servers['localhost']['enable'] = '0'
defaultConfig['misc']['port'] = '8081' categories = {}
defaultConfig['misc']['https_port'] = '9081' categories['tv'] = {}
defaultConfig['misc']['https_cert'] = 'server.cert' categories['tv']['name'] = 'tv'
defaultConfig['misc']['https_key'] = 'server.key' categories['tv']['script'] = 'sabToSickBeard.py'
defaultConfig['misc']['host'] = host categories['tv']['priority'] = '-100'
defaultConfig['misc']['web_dir'] = 'Plush' categories['movies'] = {}
defaultConfig['misc']['web_dir2'] = 'Plush' categories['movies']['name'] = 'movies'
defaultConfig['misc']['web_color'] = 'gold' categories['movies']['dir'] = 'movies'
defaultConfig['misc']['web_color2'] = 'gold' categories['movies']['priority'] = '-100'
defaultConfig['misc']['log_dir'] = 'logs' categories['music'] = {}
defaultConfig['misc']['admin_dir'] = 'admin' categories['music']['name'] = 'music'
defaultConfig['misc']['nzb_backup_dir'] = 'backup' categories['music']['dir'] = 'music'
defaultConfig['misc']['script_dir'] = 'scripts' categories['music']['priority'] = '-100'
defaultConfig['servers'] = servers
defaultConfig['categories'] = categories
if firstLaunch: sabNzbdConfig.merge(defaultConfig)
defaultConfig['misc']['download_dir'] = pSabNzbdIncomplete sabNzbdConfig.write()
defaultConfig['misc']['complete_dir'] = pSabNzbdComplete
servers = {}
servers['localhost'] = {}
servers['localhost']['host'] = 'localhost'
servers['localhost']['port'] = '119'
servers['localhost']['enable'] = '0'
categories = {}
categories['tv'] = {}
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) # also keep the autoProcessTV config up to date
sabNzbdConfig.write() autoProcessConfig = ConfigObj(os.path.join(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()
# also keep the autoProcessTV config up to date # launch SABnzbd and get the API key
autoProcessConfig = ConfigObj(os.path.join(pSabNzbdScripts, 'autoProcessTV.cfg'), create_empty=True) # ----------------------------------
defaultConfig = ConfigObj() if "true" in sabnzbd_launch:
defaultConfig['SickBeard'] = {} logging.debug('Launching SABnzbd...')
defaultConfig['SickBeard']['host'] = 'localhost' subprocess.call(sabnzbd,close_fds=True)
defaultConfig['SickBeard']['port'] = '8082' logging.debug('...done')
defaultConfig['SickBeard']['username'] = user
defaultConfig['SickBeard']['password'] = pwd
autoProcessConfig.merge(defaultConfig)
autoProcessConfig.write()
# launch SABnzbd and get the API key # SABnzbd will only complete the .ini file when we first access the web interface
# ---------------------------------- if firstLaunch:
logging.debug('Launching SABnzbd...') loadWebInterface('http://' + sabNzbdHost,user,pwd)
subprocess.call(sabnzbd,close_fds=True) sabNzbdConfig.reload()
logging.debug('...done') sabNzbdApiKey = sabNzbdConfig['misc']['api_key']
logging.debug('SABnzbd api key: ' + sabNzbdApiKey)
except Exception,e:
print 'SABnzbd: exception occurred:', e
print traceback.format_exc()
# SABnzbd end
# SABnzbd will only complete the .ini file when we first access the web interface # SickBeard start
if firstLaunch: try:
loadWebInterface('http://' + sabNzbdHost,user,pwd) # write SickBeard settings
sabNzbdConfig.reload() # ------------------------
sabNzbdApiKey = sabNzbdConfig['misc']['api_key'] sickBeardConfig = ConfigObj(pSickBeardSettings,create_empty=True)
logging.debug('SABnzbd api key: ' + sabNzbdApiKey) defaultConfig = ConfigObj()
defaultConfig['General'] = {}
defaultConfig['General']['launch_browser'] = '0'
defaultConfig['General']['version_notify'] = '0'
defaultConfig['General']['log_dir'] = 'logs'
defaultConfig['General']['web_port'] = '8082'
defaultConfig['General']['web_host'] = host
defaultConfig['General']['web_username'] = user
defaultConfig['General']['web_password'] = pwd
if "true" in sabnzbd_launch:
defaultConfig['SABnzbd'] = {}
defaultConfig['SABnzbd']['sab_username'] = user
defaultConfig['SABnzbd']['sab_password'] = pwd
defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey
defaultConfig['SABnzbd']['sab_host'] = 'http://' + sabNzbdHost + '/'
defaultConfig['XBMC'] = {}
defaultConfig['XBMC']['use_xbmc'] = '1'
defaultConfig['XBMC']['xbmc_host'] = '127.0.0.1:' + xbmcPort
defaultConfig['XBMC']['xbmc_username'] = xbmcUser
defaultConfig['XBMC']['xbmc_password'] = xbmcPwd
# write SickBeard settings if firstLaunch:
# ------------------------ defaultConfig['General']['metadata_xbmc'] = '1|1|1|1|1|1'
defaultConfig['General']['nzb_method'] = 'sabnzbd'
defaultConfig['General']['keep_processed_dir'] = '0'
defaultConfig['General']['use_banner'] = '1'
defaultConfig['General']['rename_episodes'] = '1'
defaultConfig['General']['naming_ep_name'] = '0'
defaultConfig['General']['naming_use_periods'] = '1'
defaultConfig['General']['naming_sep_type'] = '1'
defaultConfig['General']['naming_ep_type'] = '1'
defaultConfig['General']['root_dirs'] = '0|/storage/tvshows'
defaultConfig['SABnzbd']['sab_category'] = 'tv'
# workaround: on first launch, sick beard will always add
# 'http://' and trailing '/' on its own
defaultConfig['SABnzbd']['sab_host'] = sabNzbdHost
defaultConfig['XBMC']['xbmc_notify_ondownload'] = '1'
defaultConfig['XBMC']['xbmc_update_library'] = '1'
sickBeardConfig = ConfigObj(pSickBeardSettings,create_empty=True) sickBeardConfig.merge(defaultConfig)
defaultConfig = ConfigObj() sickBeardConfig.write()
defaultConfig['General'] = {}
defaultConfig['General']['launch_browser'] = '0'
defaultConfig['General']['version_notify'] = '0'
defaultConfig['General']['log_dir'] = 'logs'
defaultConfig['General']['web_port'] = '8082'
defaultConfig['General']['web_host'] = host
defaultConfig['General']['web_username'] = user
defaultConfig['General']['web_password'] = pwd
defaultConfig['SABnzbd'] = {}
defaultConfig['SABnzbd']['sab_username'] = user
defaultConfig['SABnzbd']['sab_password'] = pwd
defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey
defaultConfig['SABnzbd']['sab_host'] = 'http://' + sabNzbdHost + '/'
defaultConfig['XBMC'] = {}
defaultConfig['XBMC']['use_xbmc'] = '1'
defaultConfig['XBMC']['xbmc_host'] = '127.0.0.1:' + xbmcPort
defaultConfig['XBMC']['xbmc_username'] = xbmcUser
defaultConfig['XBMC']['xbmc_password'] = xbmcPwd
if firstLaunch: # launch SickBeard
defaultConfig['General']['metadata_xbmc'] = '1|1|1|1|1|1' # ----------------
defaultConfig['General']['nzb_method'] = 'sabnzbd' if "true" in sickbeard_launch:
defaultConfig['General']['keep_processed_dir'] = '0' logging.debug('Launching SickBeard...')
defaultConfig['General']['use_banner'] = '1' subprocess.call(sickBeard,close_fds=True)
defaultConfig['General']['rename_episodes'] = '1' logging.debug('...done')
defaultConfig['General']['naming_ep_name'] = '0' except Exception,e:
defaultConfig['General']['naming_use_periods'] = '1' print 'SickBeard: exception occurred:', e
defaultConfig['General']['naming_sep_type'] = '1' print traceback.format_exc()
defaultConfig['General']['naming_ep_type'] = '1' # SickBeard end
defaultConfig['General']['root_dirs'] = '0|/storage/tvshows'
defaultConfig['SABnzbd']['sab_category'] = 'tv'
# workaround: on first launch, sick beard will always add
# 'http://' and trailing '/' on its own
defaultConfig['SABnzbd']['sab_host'] = sabNzbdHost
defaultConfig['XBMC']['xbmc_notify_ondownload'] = '1'
defaultConfig['XBMC']['xbmc_update_library'] = '1'
sickBeardConfig.merge(defaultConfig) # CouchPotato start
sickBeardConfig.write() try:
# write CouchPotato settings
# --------------------------
couchPotatoConfig = ConfigObj(pCouchPotatoSettings,create_empty=True)
defaultConfig = ConfigObj()
defaultConfig['global'] = {}
defaultConfig['global']['launchbrowser'] = 'False'
defaultConfig['global']['updater'] = 'False'
defaultConfig['global']['password'] = pwd
defaultConfig['global']['username'] = user
defaultConfig['global']['port'] = '8083'
defaultConfig['global']['host'] = host
if "true" in sabnzbd_launch:
defaultConfig['Sabnzbd'] = {}
defaultConfig['Sabnzbd']['username'] = user
defaultConfig['Sabnzbd']['password'] = pwd
defaultConfig['Sabnzbd']['apikey'] = sabNzbdApiKey
defaultConfig['Sabnzbd']['host'] = sabNzbdHost
defaultConfig['XBMC'] = {}
defaultConfig['XBMC']['enabled'] = 'True'
defaultConfig['XBMC']['host'] = '127.0.0.1:' + xbmcPort
defaultConfig['XBMC']['username'] = xbmcUser
defaultConfig['XBMC']['password'] = xbmcPwd
# launch SickBeard if firstLaunch:
# ---------------- defaultConfig['Sabnzbd']['category'] = 'movies'
if "true" in sickbeard_launch: defaultConfig['Sabnzbd']['ppdir'] = pSabNzbdCompleteMov
logging.debug('Launching SickBeard...') defaultConfig['Renamer'] = {}
subprocess.call(sickBeard,close_fds=True) defaultConfig['Renamer']['enabled'] = 'True'
logging.debug('...done') defaultConfig['Renamer']['download'] = pSabNzbdCompleteMov
defaultConfig['Renamer']['destination'] = '/storage/videos'
defaultConfig['Renamer']['separator'] = '.'
defaultConfig['Renamer']['cleanup'] = 'True'
# write CouchPotato settings couchPotatoConfig.merge(defaultConfig)
# -------------------------- couchPotatoConfig.write()
couchPotatoConfig = ConfigObj(pCouchPotatoSettings,create_empty=True) # launch CouchPotato
defaultConfig = ConfigObj() # ------------------
defaultConfig['global'] = {} if "true" in couchpotato_launch and "0" in couchpotato_version:
defaultConfig['global']['launchbrowser'] = 'False' logging.debug('Launching CouchPotato...')
defaultConfig['global']['updater'] = 'False' subprocess.call(couchPotato,close_fds=True)
defaultConfig['global']['password'] = pwd logging.debug('...done')
defaultConfig['global']['username'] = user except Exception,e:
defaultConfig['global']['port'] = '8083' print 'CouchPotato: exception occurred:', e
defaultConfig['global']['host'] = host print traceback.format_exc()
defaultConfig['Sabnzbd'] = {} # CouchPotato end
defaultConfig['Sabnzbd']['username'] = user
defaultConfig['Sabnzbd']['password'] = pwd
defaultConfig['Sabnzbd']['apikey'] = sabNzbdApiKey
defaultConfig['Sabnzbd']['host'] = sabNzbdHost
defaultConfig['XBMC'] = {}
defaultConfig['XBMC']['enabled'] = 'True'
defaultConfig['XBMC']['host'] = '127.0.0.1:' + xbmcPort
defaultConfig['XBMC']['username'] = xbmcUser
defaultConfig['XBMC']['password'] = xbmcPwd
if firstLaunch: # CouchPotatoServer start
defaultConfig['Sabnzbd']['category'] = 'movies' try:
defaultConfig['Sabnzbd']['ppdir'] = pSabNzbdCompleteMov #convert password to md5
defaultConfig['Renamer'] = {} md5pwd = hashlib.md5(pwd).hexdigest()
defaultConfig['Renamer']['enabled'] = 'True'
defaultConfig['Renamer']['download'] = pSabNzbdCompleteMov
defaultConfig['Renamer']['destination'] = '/storage/videos'
defaultConfig['Renamer']['separator'] = '.'
defaultConfig['Renamer']['cleanup'] = 'True'
couchPotatoConfig.merge(defaultConfig) # write CouchPotatoServer settings
couchPotatoConfig.write() # --------------------------
couchPotatoServerConfig = ConfigObj(pCouchPotatoServerSettings,create_empty=True)
defaultConfig = ConfigObj()
defaultConfig['newznab'] = {}
defaultConfig['newznab']['api_key'] = ''
defaultConfig['core'] = {}
defaultConfig['core']['username'] = user
defaultConfig['core']['password'] = md5pwd
defaultConfig['core']['port'] = '8083'
defaultConfig['core']['launchbrowser'] = '0'
defaultConfig['core']['host'] = host
defaultConfig['core']['data_dir'] = pAddonHome
defaultConfig['core']['permission_folder'] = '0644'
defaultConfig['core']['permission_file'] = '0644'
defaultConfig['core']['show_wizard'] = '0'
defaultConfig['core']['debug'] = '0'
defaultConfig['core']['development'] = '0'
defaultConfig['updater'] = {}
defaultConfig['updater']['enabled'] = '0'
defaultConfig['updater']['notification'] = '0'
defaultConfig['updater']['automatic'] = '0'
if "true" in sabnzbd_launch:
defaultConfig['Sabnzbd'] = {}
defaultConfig['Sabnzbd']['username'] = user
defaultConfig['Sabnzbd']['password'] = pwd
defaultConfig['Sabnzbd']['api_key'] = sabNzbdApiKey
defaultConfig['Sabnzbd']['host'] = sabNzbdHost
defaultConfig['xbmc'] = {}
defaultConfig['xbmc']['enabled'] = '1'
defaultConfig['xbmc']['host'] = '127.0.0.1:' + xbmcPort
defaultConfig['xbmc']['username'] = xbmcUser
defaultConfig['xbmc']['password'] = xbmcPwd
# launch CouchPotato if firstLaunch:
# ------------------ defaultConfig['Sabnzbd']['category'] = 'movies'
if "true" in couchpotato_launch and "0" in couchpotato_version: defaultConfig['Sabnzbd']['pp_directory'] = pSabNzbdCompleteMov
logging.debug('Launching CouchPotato...') defaultConfig['Renamer'] = {}
subprocess.call(couchPotato,close_fds=True) defaultConfig['Renamer']['enabled'] = 'True'
logging.debug('...done') defaultConfig['Renamer']['download'] = pSabNzbdCompleteMov
defaultConfig['Renamer']['destination'] = '/storage/videos'
defaultConfig['Renamer']['separator'] = '.'
defaultConfig['Renamer']['cleanup'] = 'False'
#convert password to md5 couchPotatoServerConfig.merge(defaultConfig)
md5pwd = hashlib.md5(pwd).hexdigest() couchPotatoServerConfig.write()
# write CouchPotatoServer settings # launch CouchPotatoServer
# -------------------------- # ------------------
if "true" in couchpotato_launch and "1" in couchpotato_version:
logging.debug('Launching CouchPotatoServer...')
subprocess.call(couchPotatoServer,close_fds=True)
logging.debug('...done')
except Exception,e:
print 'CouchPotatoServer: exception occurred:', e
print traceback.format_exc()
# CouchPotatoServer end
couchPotatoServerConfig = ConfigObj(pCouchPotatoServerSettings,create_empty=True) # Headphones start
defaultConfig = ConfigObj() try:
defaultConfig['newznab'] = {} # write Headphones settings
defaultConfig['newznab']['api_key'] = '' # -------------------------
defaultConfig['core'] = {} headphonesConfig = ConfigObj(pHeadphonesSettings,create_empty=True)
defaultConfig['core']['username'] = user defaultConfig = ConfigObj()
defaultConfig['core']['password'] = md5pwd defaultConfig['General'] = {}
defaultConfig['core']['port'] = '8083' defaultConfig['General']['launch_browser'] = '0'
defaultConfig['core']['launchbrowser'] = '0' defaultConfig['General']['http_port'] = '8084'
defaultConfig['core']['host'] = host defaultConfig['General']['http_host'] = host
defaultConfig['core']['data_dir'] = pAddonHome defaultConfig['General']['http_username'] = user
defaultConfig['core']['permission_folder'] = '0644' defaultConfig['General']['http_password'] = pwd
defaultConfig['core']['permission_file'] = '0644' if "true" in sabnzbd_launch:
defaultConfig['core']['show_wizard'] = '0' defaultConfig['SABnzbd'] = {}
defaultConfig['core']['debug'] = '0' defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey
defaultConfig['core']['development'] = '0' defaultConfig['SABnzbd']['sab_host'] = sabNzbdHost
defaultConfig['updater'] = {} defaultConfig['SABnzbd']['sab_username'] = user
defaultConfig['updater']['enabled'] = '0' defaultConfig['SABnzbd']['sab_password'] = pwd
defaultConfig['updater']['notification'] = '0'
defaultConfig['updater']['automatic'] = '0'
defaultConfig['Sabnzbd'] = {}
defaultConfig['Sabnzbd']['username'] = user
defaultConfig['Sabnzbd']['password'] = pwd
defaultConfig['Sabnzbd']['api_key'] = sabNzbdApiKey
defaultConfig['Sabnzbd']['host'] = sabNzbdHost
defaultConfig['xbmc'] = {}
defaultConfig['xbmc']['enabled'] = '1'
defaultConfig['xbmc']['host'] = '127.0.0.1:' + xbmcPort
defaultConfig['xbmc']['username'] = xbmcUser
defaultConfig['xbmc']['password'] = xbmcPwd
if firstLaunch: if firstLaunch:
defaultConfig['Sabnzbd']['category'] = 'movies' defaultConfig['SABnzbd']['sab_category'] = 'music'
defaultConfig['Sabnzbd']['pp_directory'] = pSabNzbdCompleteMov defaultConfig['General']['music_dir'] = '/storage/music'
defaultConfig['Renamer'] = {} defaultConfig['General']['destination_dir'] = '/storage/music'
defaultConfig['Renamer']['enabled'] = 'True' defaultConfig['General']['download_dir'] = '/storage/downloads/music'
defaultConfig['Renamer']['download'] = pSabNzbdCompleteMov defaultConfig['General']['move_files'] = '1'
defaultConfig['Renamer']['destination'] = '/storage/videos' defaultConfig['General']['rename_files'] = '1'
defaultConfig['Renamer']['separator'] = '.'
defaultConfig['Renamer']['cleanup'] = 'False'
couchPotatoServerConfig.merge(defaultConfig) headphonesConfig.merge(defaultConfig)
couchPotatoServerConfig.write() headphonesConfig.write()
# launch CouchPotatoServer # launch Headphones
# ------------------ # -----------------
if "true" in couchpotato_launch and "1" in couchpotato_version: if "true" in headphones_launch:
logging.debug('Launching CouchPotatoServer...') logging.debug('Launching Headphones...')
subprocess.call(couchPotatoServer,close_fds=True) subprocess.call(headphones,close_fds=True)
logging.debug('...done') logging.debug('...done')
except Exception,e:
# write Headphones settings print 'Headphones: exception occurred:', e
# ------------------------- print traceback.format_exc()
# Headphones end
headphonesConfig = ConfigObj(pHeadphonesSettings,create_empty=True)
defaultConfig = ConfigObj()
defaultConfig['General'] = {}
defaultConfig['General']['launch_browser'] = '0'
defaultConfig['General']['http_port'] = '8084'
defaultConfig['General']['http_host'] = host
defaultConfig['General']['http_username'] = user
defaultConfig['General']['http_password'] = pwd
defaultConfig['SABnzbd'] = {}
defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey
defaultConfig['SABnzbd']['sab_host'] = sabNzbdHost
defaultConfig['SABnzbd']['sab_username'] = user
defaultConfig['SABnzbd']['sab_password'] = pwd
if firstLaunch:
defaultConfig['SABnzbd']['sab_category'] = 'music'
defaultConfig['General']['music_dir'] = '/storage/music'
defaultConfig['General']['destination_dir'] = '/storage/music'
defaultConfig['General']['download_dir'] = '/storage/downloads/music'
defaultConfig['General']['move_files'] = '1'
defaultConfig['General']['rename_files'] = '1'
headphonesConfig.merge(defaultConfig)
headphonesConfig.write()
# launch Headphones
# -----------------
if "true" in headphones_launch:
logging.debug('Launching Headphones...')
subprocess.call(headphones,close_fds=True)
logging.debug('...done')

View File

@ -6,6 +6,7 @@
<string id="1010">User Settings</string> <string id="1010">User Settings</string>
<string id="1022">Username</string> <string id="1022">Username</string>
<string id="1023">Password</string> <string id="1023">Password</string>
<string id="1024">Enable SABnzbd</string>>
<string id="1025">Enable Sickbeard</string> <string id="1025">Enable Sickbeard</string>
<string id="1026">Enable Couchpotato</string> <string id="1026">Enable Couchpotato</string>
<string id="1027">Couchpotato Version</string> <string id="1027">Couchpotato Version</string>

View File

@ -7,6 +7,7 @@
<setting type="sep" /> <setting type="sep" />
<setting id="SABNZBD_USER" type="text" label="1022" default="openelec"/> <setting id="SABNZBD_USER" type="text" label="1022" default="openelec"/>
<setting id="SABNZBD_PWD" type="text" label="1023" default="openelec"/> <setting id="SABNZBD_PWD" type="text" label="1023" default="openelec"/>
<setting id="SABNZBD_LAUNCH" type="bool" label="1024" default="true" />
<setting id="SICKBEARD_LAUNCH" type="bool" label="1025" default="true" /> <setting id="SICKBEARD_LAUNCH" type="bool" label="1025" default="true" />
<setting id="COUCHPOTATO_LAUNCH" type="bool" label="1026" default="true" /> <setting id="COUCHPOTATO_LAUNCH" type="bool" label="1026" default="true" />
<setting id="COUCHPOTATO_VERSION" type="enum" label="1027" default="0" values="Version 1|Version 2" enable="eq(-1,true)" /> <setting id="COUCHPOTATO_VERSION" type="enum" label="1027" default="0" values="Version 1|Version 2" enable="eq(-1,true)" />

View File

@ -19,7 +19,7 @@
################################################################################ ################################################################################
PKG_NAME="xbmc-addon-vuplus" PKG_NAME="xbmc-addon-vuplus"
PKG_VERSION="50571e7" PKG_VERSION="6e31a01"
PKG_REV="1" PKG_REV="1"
PKG_ARCH="any" PKG_ARCH="any"
PKG_LICENSE="GPL" PKG_LICENSE="GPL"