check url after replace to see if it look ok

This commit is contained in:
sfaulds 2016-11-17 16:55:44 +11:00
parent 5b86aa1ca9
commit 5d06f04d1d
2 changed files with 5 additions and 9 deletions

View file

@ -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,