mirror of
https://github.com/fHDHR/fHDHR_NextPVR.git
synced 2025-12-06 05:36:59 -05:00
Update for Platform Compatibility
This commit is contained in:
parent
8ac30a7018
commit
0d77ddf582
@ -23,7 +23,7 @@ def clean_exit():
|
||||
class EPGhandler():
|
||||
|
||||
def __init__(self, config, serviceproxy):
|
||||
self.config = config.config
|
||||
self.config = config.copy()
|
||||
self.epgtypes = epgtypes.EPGTypes(config, serviceproxy)
|
||||
|
||||
def get_xmltv(self, base_url):
|
||||
@ -127,7 +127,7 @@ class EPGhandler():
|
||||
|
||||
def epgServerProcess(config, epghandling):
|
||||
|
||||
sleeptime = int(config.config[config.config["fakehdhr"]["epg_method"]]["epg_update_frequency"])
|
||||
sleeptime = int(config[config["fakehdhr"]["epg_method"]]["epg_update_frequency"])
|
||||
|
||||
try:
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ from . import empty
|
||||
class EPGTypes():
|
||||
|
||||
def __init__(self, config, serviceproxy):
|
||||
self.config = config.config
|
||||
self.config = config.copy()
|
||||
self.proxy = serviceproxy
|
||||
self.zap2it = zap2it.ZapEPG(config, serviceproxy)
|
||||
self.empty = empty.EmptyEPG(config, serviceproxy)
|
||||
|
||||
@ -7,14 +7,14 @@ class EmptyEPG():
|
||||
|
||||
def __init__(self, config, serviceproxy):
|
||||
|
||||
self.config = config.config
|
||||
self.config = config.copy()
|
||||
self.serviceproxy = serviceproxy
|
||||
|
||||
self.postalcode = None
|
||||
|
||||
self.epg_cache = None
|
||||
self.cache_dir = config.config["empty"]["empty_cache"]
|
||||
self.epg_cache_file = config.config["empty"]["empty_cache_file"]
|
||||
self.cache_dir = self.config["empty"]["empty_cache"]
|
||||
self.epg_cache_file = self.config["empty"]["empty_cache_file"]
|
||||
self.epg_cache = self.epg_cache_open()
|
||||
|
||||
def epg_cache_open(self):
|
||||
|
||||
@ -36,14 +36,14 @@ class ZapEPG():
|
||||
|
||||
def __init__(self, config, serviceproxy):
|
||||
|
||||
self.config = config.config
|
||||
self.config = config.copy()
|
||||
self.serviceproxy = serviceproxy
|
||||
|
||||
self.postalcode = None
|
||||
|
||||
self.epg_cache = None
|
||||
self.cache_dir = config.config["main"]["zap_web_cache"]
|
||||
self.epg_cache_file = config.config["zap2it"]["epg_cache"]
|
||||
self.cache_dir = self.config["main"]["zap_web_cache"]
|
||||
self.epg_cache_file = self.config["zap2it"]["epg_cache"]
|
||||
self.epg_cache = self.epg_cache_open()
|
||||
|
||||
def get_location(self):
|
||||
|
||||
@ -39,7 +39,7 @@ class HDHR_Hub():
|
||||
self.tuners = 0
|
||||
|
||||
def hubprep(self, config, serviceproxy, epghandling):
|
||||
self.config = config.config
|
||||
self.config = config
|
||||
self.max_tuners = int(self.config["fakehdhr"]["tuner_count"])
|
||||
self.station_scan = False
|
||||
self.serviceproxy = serviceproxy
|
||||
@ -366,7 +366,7 @@ class HDHR_HTTP_Server():
|
||||
return Response(status=200, response=currenthtmlerror, mimetype='text/html')
|
||||
|
||||
def __init__(self, config):
|
||||
self.config = config.config
|
||||
self.config = config.copy()
|
||||
|
||||
def run(self):
|
||||
self.http = WSGIServer((
|
||||
|
||||
10
main.py
10
main.py
@ -40,25 +40,25 @@ if __name__ == '__main__':
|
||||
config = fhdhrconfig.HDHRConfig(script_dir, args)
|
||||
|
||||
# Open proxyservice
|
||||
serviceproxy = proxyservice.proxyserviceFetcher(config)
|
||||
serviceproxy = proxyservice.proxyserviceFetcher(config.config)
|
||||
|
||||
# Open EPG Handler
|
||||
epghandling = epghandler.EPGhandler(config, serviceproxy)
|
||||
epghandling = epghandler.EPGhandler(config.config, serviceproxy)
|
||||
|
||||
try:
|
||||
|
||||
print("Starting EPG thread...")
|
||||
epgServer = Process(target=epghandler.epgServerProcess, args=(config, epghandling))
|
||||
epgServer = Process(target=epghandler.epgServerProcess, args=(config.config.copy(), epghandling))
|
||||
epgServer.start()
|
||||
|
||||
print("Starting fHDHR Interface")
|
||||
fhdhrServer = Process(target=fakehdhr.interface_start, args=(config, serviceproxy, epghandling))
|
||||
fhdhrServer = Process(target=fakehdhr.interface_start, args=(config.config.copy(), serviceproxy, epghandling))
|
||||
fhdhrServer.start()
|
||||
|
||||
if (config.config["fakehdhr"]["discovery_address"] and
|
||||
config.config["fakehdhr"]["discovery_address"] != "0.0.0.0"):
|
||||
print("Starting SSDP server...")
|
||||
ssdpServer = Process(target=ssdpserver.ssdpServerProcess, args=(config,))
|
||||
ssdpServer = Process(target=ssdpserver.ssdpServerProcess, args=(config.config.copy(),))
|
||||
ssdpServer.daemon = True
|
||||
ssdpServer.start()
|
||||
else:
|
||||
|
||||
@ -35,12 +35,12 @@ class NextPVR_Auth():
|
||||
sidfile = None
|
||||
|
||||
def __init__(self, config):
|
||||
self.sidfile = config.config["proxy"]["sidfile"]
|
||||
self.config["npvrPIN"] = config.config["proxy"]["pin"]
|
||||
self.sidfile = config["proxy"]["sidfile"]
|
||||
self.config["npvrPIN"] = config["proxy"]["pin"]
|
||||
self.config["npvrURL"] = ('%s%s:%s' %
|
||||
("https://" if config.config["proxy"]["ssl"] else "http://",
|
||||
config.config["proxy"]["address"],
|
||||
str(config.config["proxy"]["port"]),
|
||||
("https://" if config["proxy"]["ssl"] else "http://",
|
||||
config["proxy"]["address"],
|
||||
str(config["proxy"]["port"]),
|
||||
))
|
||||
|
||||
def _check_sid(self):
|
||||
@ -97,10 +97,10 @@ def duration_nextpvr_minutes(starttime, endtime):
|
||||
class proxyserviceFetcher():
|
||||
|
||||
def __init__(self, config):
|
||||
self.config = config.config
|
||||
self.config = config.copy()
|
||||
|
||||
self.epg_cache = None
|
||||
self.epg_cache_file = config.config["proxy"]["epg_cache"]
|
||||
self.epg_cache_file = self.config["proxy"]["epg_cache"]
|
||||
|
||||
self.urls = {}
|
||||
self.url_assembler()
|
||||
|
||||
@ -28,10 +28,10 @@ def ssdpServerProcess(config):
|
||||
ssdp = SSDPServer()
|
||||
ssdp.ssdp_port = 1900
|
||||
ssdp.register('local',
|
||||
'uuid:' + config.config["main"]["uuid"] + '::upnp:rootdevice',
|
||||
'uuid:' + config["main"]["uuid"] + '::upnp:rootdevice',
|
||||
'upnp:rootdevice',
|
||||
'http://' + config.config["fakehdhr"]["discovery_address"] + ':' +
|
||||
config.config["fakehdhr"]["port"] + '/device.xml')
|
||||
'http://' + config["fakehdhr"]["discovery_address"] + ':' +
|
||||
config["fakehdhr"]["port"] + '/device.xml')
|
||||
try:
|
||||
ssdp.run()
|
||||
except KeyboardInterrupt:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user