from xbmc import executebuiltin, Monitor from resources.lib.server import create_server from resources.lib.wsgi_app import * from resources.lib.utils import notify, clear_session, RUNSCRIPT executebuiltin(RUNSCRIPT) monitor = Monitor() httpd = create_server(app, LOCALHOST, port=port) httpd.timeout = 0.1 starting = True while not monitor.abortRequested(): httpd.handle_request() if starting: notify(translate(32006) % port) starting = False httpd.socket.close() clear_session() log(translate(32003))
from xbmc import executebuiltin, Monitor from resources.lib.server import create_server from resources.lib.wsgi_app import * from resources.lib.utils import * executebuiltin(RUNSCRIPT) monitor = Monitor() httpd = create_server(app, port=port) httpd.timeout = 0.1 starting = True while not monitor.abortRequested(): httpd.handle_request() if starting: notify(translate(32006) % port) starting = False httpd.socket.close() settings.first_request = False log(translate(32003))
# -*- coding: utf-8 -*- from xbmc import executebuiltin, Monitor from resources.lib.server import create_server from resources.lib.wsgi_app import * from resources.lib.utils import * xbmc.executebuiltin('RunScript(plugin.program.freebgtvs, False)') monitor = Monitor() httpd = create_server(BIND_IP, app, port=port) httpd.timeout = 0.1 starting = True while not monitor.abortRequested(): httpd.handle_request() if starting: notify_success('PVR backend стартира на порт %s' % port) starting = False httpd.socket.close()
# -*- coding: utf-8 -*- from xbmc import executebuiltin, Monitor from resources.lib.server import create_server from resources.lib.wsgi_app import * from kodibgcommon.utils import get_addon_id, settings executebuiltin('RunPlugin("plugin://%s/?action=generate_playlist")' % get_addon_id()) monitor = Monitor() httpd = create_server('0.0.0.0', app, port=port) httpd.timeout = 0.1 starting = True while not monitor.abortRequested(): httpd.handle_request() if starting: notify_success("%s started on port %s" % (get_addon_id(), port)) starting = False httpd.socket.close() settings.first_request_sent = False log("%s started listening on %s" % (get_addon_id(), port))