-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathservice.py
More file actions
36 lines (29 loc) · 919 Bytes
/
service.py
File metadata and controls
36 lines (29 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- coding: utf-8 -*-
from resources.lib import proxy
from codequick import Script
from codequick.script import Settings
from socketserver import ThreadingTCPServer
import threading
from xbmc import Monitor, executebuiltin
from kodi_six import xbmcgui
def serveForever(handler):
try:
handler.serve_forever()
except Exception as e:
Script.log(e, lvl=Script.DEBUG)
pass
ThreadingTCPServer.allow_reuse_address = True
_PORT = 48996
handler = ThreadingTCPServer(("", _PORT), proxy.JioTVProxy)
t = threading.Thread(target=serveForever, args=(handler,))
t.setDaemon(True)
t.start()
if Settings.get_boolean("m3ugen"):
executebuiltin(
"RunPlugin(plugin://plugin.video.jiotv/resources/lib/main/m3ugen/?notify=no)")
monitor = Monitor()
while not monitor.abortRequested():
if monitor.waitForAbort(10):
handler.shutdown()
handler.server_close()
break