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