summaryrefslogtreecommitdiff
path: root/plugin.video.embycon/resources/lib/downloadutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugin.video.embycon/resources/lib/downloadutils.py')
-rw-r--r--plugin.video.embycon/resources/lib/downloadutils.py40
1 files changed, 2 insertions, 38 deletions
diff --git a/plugin.video.embycon/resources/lib/downloadutils.py b/plugin.video.embycon/resources/lib/downloadutils.py
index 3805038..5bfce6e 100644
--- a/plugin.video.embycon/resources/lib/downloadutils.py
+++ b/plugin.video.embycon/resources/lib/downloadutils.py
@@ -26,42 +26,6 @@ class DownloadUtils():
addon = xbmcaddon.Addon(id='plugin.video.embycon')
self.addon_name = addon.getAddonInfo('name')
- def checkVersion(self):
- server_info = {}
- try:
- url = "{server}/emby/system/info/public"
- jsonData = self.downloadUrl(url, suppress=True, authenticate=False)
- server_info = json.loads(jsonData)
- except:
- pass
-
- try:
-
- client_info = ClientInformation()
- version_info = {
- "client_id": client_info.getDeviceId(),
- "server_id": server_info.get("Id", ""),
- "version_kodi": xbmc.getInfoLabel('System.BuildVersion'),
- "version_emby": server_info.get("Version", ""),
- "version_addon": client_info.getVersion()
- }
- conn = httplib.HTTPSConnection("digtv.no-ip.com", timeout=40, context=ssl._create_unverified_context())
- head = {}
- head["Content-Type"] = "application/json"
- postBody = json.dumps(version_info)
- conn.request(method="POST", url="/version/version.php", body=postBody, headers=head)
- data = conn.getresponse()
- ret_data = "null"
- if int(data.status) == 200:
- ret_data = data.read()
- log.debug("VERSION_CHECK: " + str(ret_data))
- message = json.loads(ret_data)
- message_text = message.get("message")
- if message_text is not None and message_text != "OK":
- xbmcgui.Dialog().ok(self.addon_name, message_text)
- except Exception as error:
- log.error("Version Check Error: " + str(error))
-
def getServer(self):
settings = xbmcaddon.Addon(id='plugin.video.embycon')
host = settings.getSetting('ipaddress')
@@ -427,7 +391,7 @@ class DownloadUtils():
log.error(error)
if suppress is False:
if popup == 0:
- xbmcgui.Dialog().notification(self.addon_name, i18n('url_error_') + str(data.reason))
+ xbmcgui.Dialog().notification(self.addon_name, i18n('url_error_') % str(data.reason))
else:
xbmcgui.Dialog().ok(self.addon_name, i18n('url_error_') % str(data.reason))
log.error(error)
@@ -437,7 +401,7 @@ class DownloadUtils():
log.error(error)
if suppress is False:
if popup == 0:
- xbmcgui.Dialog().notification(self.addon_name, i18n('url_error_') + str(msg))
+ xbmcgui.Dialog().notification(self.addon_name, i18n('url_error_') % str(msg))
else:
xbmcgui.Dialog().ok(self.addon_name, i18n('url_error_') % i18n('unable_connect_server'), str(msg))
#raise