def fetch_url(self, url, file): f = xbmcvfs.File(file, 'wb') f.write(requests.get(url).content) f.write(url) f.close()