def save_file(self, response, hash, url):
"""Save a downloaded file to the cache and stream it."""
+ if response.code != 200:
+ log.msg('File was not found (%r): %s' % (response, url))
+ return response
+
log.msg('Returning file: %s' % url)
parsed = urlparse(url)
self.updatedFile(url[:-len(ext)], decFile.path)
if self.manager:
- self.manager.download_complete(hash, url, destFile.path)
+ self.manager.cached_file(hash, url, destFile.path)
else:
log.msg("Hashes don't match %s != %s: %s" % (hash.hexexpected(), hash.hexdigest(), url))