diff options
author | Shaun <shaun@bluebit.com.au> | 2017-11-25 15:04:26 +1100 |
---|---|---|
committer | Shaun <shaun@bluebit.com.au> | 2017-11-25 15:04:26 +1100 |
commit | 362d0e0c342f9e17734dab8b4d102d55677ec412 (patch) | |
tree | 5db442ecb767b9426a11de518e14e0838f063bf8 /plugin.video.embycon/resources/lib/downloadutils.py | |
parent | c2d65f62c77f819face074a31be24f782e15f8fa (diff) |
[plugin.video.embycon] 1.3.47
Diffstat (limited to 'plugin.video.embycon/resources/lib/downloadutils.py')
-rw-r--r-- | plugin.video.embycon/resources/lib/downloadutils.py | 40 |
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 |