mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-03 16:07:51 +00:00
Preconfigures Headphones/SABnzbd integration
This commit is contained in:
parent
1ee131a057
commit
5e3352229a
@ -38,6 +38,7 @@ logging.basicConfig(filename='/storage/.xbmc/temp/sabnzbd-suite.log',
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# helper functions
|
# helper functions
|
||||||
# ----------------
|
# ----------------
|
||||||
|
|
||||||
@ -81,6 +82,7 @@ pHeadphonesSettings = os.path.join(pAddonHome, 'headphones.ini')
|
|||||||
# directories
|
# directories
|
||||||
pSabNzbdComplete = '/storage/downloads'
|
pSabNzbdComplete = '/storage/downloads'
|
||||||
pSabNzbdCompleteMov = '/storage/downloads/movies'
|
pSabNzbdCompleteMov = '/storage/downloads/movies'
|
||||||
|
pSabNzbdCompleteMusic = '/storage/downloads/music'
|
||||||
pSabNzbdIncomplete = '/storage/downloads/incomplete'
|
pSabNzbdIncomplete = '/storage/downloads/incomplete'
|
||||||
pSickBeardTvScripts = os.path.join(pAddon, 'SickBeard/autoProcessTV')
|
pSickBeardTvScripts = os.path.join(pAddon, 'SickBeard/autoProcessTV')
|
||||||
pSabNzbdScripts = os.path.join(pAddonHome, 'scripts')
|
pSabNzbdScripts = os.path.join(pAddonHome, 'scripts')
|
||||||
@ -104,6 +106,8 @@ sabNzbdHost = '127.0.0.1:8081'
|
|||||||
addonId = 'service.downloadmanager.SABnzbd-Suite'
|
addonId = 'service.downloadmanager.SABnzbd-Suite'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# create directories and settings on first launch
|
# create directories and settings on first launch
|
||||||
# -----------------------------------------------
|
# -----------------------------------------------
|
||||||
|
|
||||||
@ -113,14 +117,9 @@ if firstLaunch:
|
|||||||
createDir(pAddonHome)
|
createDir(pAddonHome)
|
||||||
createDir(pSabNzbdComplete)
|
createDir(pSabNzbdComplete)
|
||||||
createDir(pSabNzbdCompleteMov)
|
createDir(pSabNzbdCompleteMov)
|
||||||
|
createDir(pSabNzbdCompleteMusic)
|
||||||
createDir(pSabNzbdIncomplete)
|
createDir(pSabNzbdIncomplete)
|
||||||
createDir(pSabNzbdScripts)
|
createDir(pSabNzbdScripts)
|
||||||
# copy and sanitize sickbeards autoprocessing scripts
|
|
||||||
# text = open(pSickBeardTvScript, 'rb').read().replace('\r\n', '\n')
|
|
||||||
# dest = open(pTvScriptDestination, 'wb')
|
|
||||||
# dest.write('#!/usr/bin/python\n') # add missing shebang
|
|
||||||
# dest.write(text)
|
|
||||||
# dest.close()
|
|
||||||
shutil.copy(os.path.join(pSickBeardTvScripts,'sabToSickBeard.py'), pSabNzbdScripts)
|
shutil.copy(os.path.join(pSickBeardTvScripts,'sabToSickBeard.py'), pSabNzbdScripts)
|
||||||
shutil.copy(os.path.join(pSickBeardTvScripts,'autoProcessTV.py'), pSabNzbdScripts)
|
shutil.copy(os.path.join(pSickBeardTvScripts,'autoProcessTV.py'), pSabNzbdScripts)
|
||||||
os.chmod(os.path.join(pSabNzbdScripts,'sabToSickBeard.py'), 0755)
|
os.chmod(os.path.join(pSabNzbdScripts,'sabToSickBeard.py'), 0755)
|
||||||
@ -133,6 +132,7 @@ if firstLaunch:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# read addon and xbmc settings
|
# read addon and xbmc settings
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
|
|
||||||
@ -155,10 +155,6 @@ xbmcServices = xbmcSettings.getElementsByTagName('services')[0]
|
|||||||
xbmcPort = xbmcServices.getElementsByTagName('webserverport')[0].firstChild.data
|
xbmcPort = xbmcServices.getElementsByTagName('webserverport')[0].firstChild.data
|
||||||
xbmcUser = xbmcServices.getElementsByTagName('webserverusername')[0].firstChild.data
|
xbmcUser = xbmcServices.getElementsByTagName('webserverusername')[0].firstChild.data
|
||||||
xbmcPwd = xbmcServices.getElementsByTagName('webserverpassword')[0].firstChild.data
|
xbmcPwd = xbmcServices.getElementsByTagName('webserverpassword')[0].firstChild.data
|
||||||
logging.debug('User: ' + str(user) + ', Pwd: ' + str(pwd) +
|
|
||||||
', Ip: ' + str(host) + ', Keep Awake: ' + str(sabNzbdKeepAwake))
|
|
||||||
logging.debug('XBMC User: ' + str(xbmcUser) + ', XBMC Pwd: ' + str(xbmcPwd) +
|
|
||||||
', XBMC Port: ' + str(xbmcPort))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -214,6 +210,10 @@ if firstLaunch:
|
|||||||
categories['movies']['name'] = 'movies'
|
categories['movies']['name'] = 'movies'
|
||||||
categories['movies']['dir'] = 'movies'
|
categories['movies']['dir'] = 'movies'
|
||||||
categories['movies']['priority'] = '-100'
|
categories['movies']['priority'] = '-100'
|
||||||
|
categories['music'] = {}
|
||||||
|
categories['music']['name'] = 'music'
|
||||||
|
categories['music']['dir'] = 'music'
|
||||||
|
categories['music']['priority'] = '-100'
|
||||||
defaultConfig['servers'] = servers
|
defaultConfig['servers'] = servers
|
||||||
defaultConfig['categories'] = categories
|
defaultConfig['categories'] = categories
|
||||||
|
|
||||||
@ -241,8 +241,6 @@ logging.debug('Launching SABnzbd...')
|
|||||||
subprocess.call(sabnzbd)
|
subprocess.call(sabnzbd)
|
||||||
logging.debug('...done')
|
logging.debug('...done')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# SABnzbd will only complete the .ini file when we first access the web interface
|
# SABnzbd will only complete the .ini file when we first access the web interface
|
||||||
if firstLaunch:
|
if firstLaunch:
|
||||||
loadWebInterface('http://' + sabNzbdHost,user,pwd)
|
loadWebInterface('http://' + sabNzbdHost,user,pwd)
|
||||||
@ -251,6 +249,8 @@ sabNzbdApiKey = sabNzbdConfig['misc']['api_key']
|
|||||||
logging.debug('SABnzbd api key: ' + sabNzbdApiKey)
|
logging.debug('SABnzbd api key: ' + sabNzbdApiKey)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# write SickBeard settings
|
# write SickBeard settings
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
|
||||||
@ -298,6 +298,7 @@ sickBeardConfig.write()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# launch SickBeard
|
# launch SickBeard
|
||||||
# ----------------
|
# ----------------
|
||||||
logging.debug('Launching SickBeard...')
|
logging.debug('Launching SickBeard...')
|
||||||
@ -306,6 +307,7 @@ logging.debug('...done')
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# write CouchPotato settings
|
# write CouchPotato settings
|
||||||
# --------------------------
|
# --------------------------
|
||||||
|
|
||||||
@ -344,6 +346,7 @@ couchPotatoConfig.write()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# launch CouchPotato
|
# launch CouchPotato
|
||||||
# ------------------
|
# ------------------
|
||||||
|
|
||||||
@ -363,19 +366,28 @@ defaultConfig['General'] = {}
|
|||||||
defaultConfig['General']['launch_browser'] = '0'
|
defaultConfig['General']['launch_browser'] = '0'
|
||||||
defaultConfig['General']['http_port'] = '8084'
|
defaultConfig['General']['http_port'] = '8084'
|
||||||
defaultConfig['General']['http_host'] = host
|
defaultConfig['General']['http_host'] = host
|
||||||
defaultConfig['General']['music_dir'] = 'storage/music'
|
defaultConfig['General']['http_username'] = user
|
||||||
defaultConfig['General']['destination_dir'] = 'storage/music'
|
defaultConfig['General']['http_password'] = pwd
|
||||||
defaultConfig['General']['download_dir'] = 'storage/music'
|
|
||||||
defaultConfig['SABnzbd'] = {}
|
defaultConfig['SABnzbd'] = {}
|
||||||
defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey
|
defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey
|
||||||
defaultConfig['SABnzbd']['sab_host'] = sabNzbdHost
|
defaultConfig['SABnzbd']['sab_host'] = sabNzbdHost
|
||||||
|
defaultConfig['SABnzbd']['sab_username'] = user
|
||||||
|
defaultConfig['SABnzbd']['sab_password'] = pwd
|
||||||
|
|
||||||
|
if firstLaunch:
|
||||||
defaultConfig['SABnzbd']['sab_category'] = 'music'
|
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.merge(defaultConfig)
|
||||||
headphonesConfig.write()
|
headphonesConfig.write()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# launch Headphones
|
# launch Headphones
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user