1
0
mirror of https://github.com/fHDHR/fHDHR_NextPVR.git synced 2025-12-06 10:16:58 -05:00

Merge pull request #12 from deathbybandaid/dev

Update for Platform Compatibility
This commit is contained in:
Deathbybandaid 2020-10-04 18:41:51 -04:00 committed by GitHub
commit 416c6b7f47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 26 deletions

View File

@ -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:

View File

@ -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)

View File

@ -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):

View File

@ -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):

View File

@ -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
View File

@ -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:

View File

@ -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()

View File

@ -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: