diff --git a/addon.xml b/addon.xml index 268fc61..2bede52 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/resources/lib/plugin.py b/resources/lib/plugin.py index e3f917c..aa4707c 100644 --- a/resources/lib/plugin.py +++ b/resources/lib/plugin.py @@ -106,7 +106,7 @@ def play(params): # Read the proxy address - proxy = Movistar.load_file_if_exists(os.path.join(profile_dir, 'proxy.txt')) + proxy = addon.getSetting('proxy_address') LOG('proxy address: {}'.format(proxy)) if addon.getSettingBool('manifest_modification') and proxy: @@ -122,7 +122,7 @@ def play(params): #headers += '&Host=wv-ottlic-f3.imagenio.telefonica.net' manifest_headers = 'User-Agent=' + useragent - if stype in ['tv', 'u7d', 'rec']: + if True: #stype in ['tv', 'u7d', 'rec']: cdn_token = m.cache.load('cdn.conf') if not cdn_token: cdn_token = m.get_cdntoken() diff --git a/resources/lib/proxy.py b/resources/lib/proxy.py index 5671467..8c49c09 100644 --- a/resources/lib/proxy.py +++ b/resources/lib/proxy.py @@ -276,6 +276,7 @@ class Proxy(object): self._httpd_thread = threading.Thread(target=self._server.serve_forever) self._httpd_thread.start() self.proxy_address = 'http://{}:{}'.format(HOST, port) + addon.setSetting('proxy_address', self.proxy_address) self.started = True LOG("Proxy Started: {}:{}".format(HOST, port)) diff --git a/resources/settings.xml b/resources/settings.xml index 1c987ca..fe33d58 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -13,6 +13,7 @@ --> + diff --git a/service.py b/service.py index 2f1bcf7..fe89b5e 100644 --- a/service.py +++ b/service.py @@ -9,7 +9,6 @@ import xbmcgui from resources.lib.proxy import Proxy from resources.lib.addon import * from resources.lib.log import LOG -from resources.lib.cache import Cache def export_epg(): from datetime import datetime, timedelta @@ -37,8 +36,6 @@ if __name__ == '__main__': proxy = Proxy() proxy.start() LOG('proxy_address: {}'.format(proxy.proxy_address)) - cache = Cache(profile_dir) - cache.save_file('proxy.txt', proxy.proxy_address) if addon.getSettingBool('export_epg'): try: