def getLocation(url): #get 302 response location if 'tinyurl' in url: cookiePath = xbmc.translatePath(os.path.join(Paths.cacheDir, 'cookies.lwp')) request = CachedWebRequest(cookiePath, Paths.cacheDir) return request.getLocation(url) return url