if not self._force_download and resource.exists_locally(download_path):
logging.info("URL %s already downloaded: reusing %s.",
url, download_path)
self._recorded_url_infos[url] = self._url_infos[url]
return promise.Promise.resolve(download_path)
// There is a slight difference between downloader and extractor here:
// the extractor manages its own temp directory, while the DownloadManager
// manages the temp directory of downloader.
After Change
// Compute the existing path if the file was previously downloaded
url_path = self._get_final_dl_path(
url, hashlib.sha256(url.encode("utf-8")).hexdigest())
existing_path = self._find_existing_path(url=url, url_path=url_path)
// If register checksums and file already downloaded, then:
// * Record the url_infos of the downloaded file
// * Rename the filename `url_path` -> `file_path`, and return it.