forked from Geletinousamigo/plugin.video.jiotv
-
Notifications
You must be signed in to change notification settings - Fork 20
/
service.py
40 lines (32 loc) · 1.39 KB
/
service.py
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
37
38
39
40
# -*- 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)
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 not Settings.get_boolean("popup"):
# xbmcgui.Dialog().ok("JioTV Notification",
# "Now you can create your custom playlist from BotAllen Dashboard. [CR]Find out more at [B]https://botallen.com/#dashboard[/B] [CR][CR]If you like this add-on then consider donating from [B]https://botallen.com/#donate[/B] [CR][CR]Github: [B]https://github.com/botallen/repository.botallen[/B] [CR]Discord: [B]https://botallen.com/discord[/B] [CR][CR][I]You can disable this popup from settings[/I]")
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