From 5d06f04d1d418704c3d35f9346e5884b7c0133bd Mon Sep 17 00:00:00 2001 From: sfaulds Date: Thu, 17 Nov 2016 16:55:44 +1100 Subject: [PATCH] check url after replace to see if it look ok --- addon.xml | 2 +- resources/lib/downloadutils.py | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/addon.xml b/addon.xml index ec17d9b5..1ca62726 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/resources/lib/downloadutils.py b/resources/lib/downloadutils.py index 6a2acaf1..54c35ddf 100644 --- a/resources/lib/downloadutils.py +++ b/resources/lib/downloadutils.py @@ -225,18 +225,14 @@ class DownloadUtils(object): 'headers': self.get_header(server_id, authenticate) }) - if not server['Server'] or not server['UserId']: - log.error("Server or UserId not set, not logged in, returning None") - xbmcgui.Dialog().notification(heading=lang(29999), - message="Not Logged In", - icon=xbmcgui.NOTIFICATION_ERROR, - time=5000) - raise internal_exceptions.ExceptionWrapper("Not Logged In") - # Replace for the real values url = url.replace("{server}", server['Server']) url = url.replace("{UserId}", server['UserId']) + # does the URL look ok + if url.startswith('/'): + raise internal_exceptions.ExceptionWrapper("URL Error: " + url) + ##### PREPARE REQUEST ##### kwargs.update({ 'url': url,