def METHOD_NAME(
    self,
    d: str,
    overwrite: bool = False,
    callback: Optional[ProgressCallback] = None,
) -> str:
    if not os.path.exists(d):
        raise DownloadError(f"Directory {d} does not exist")
    if not os.path.isdir(d):
        raise DownloadError(f"{d} is not a directory")
    url = urllib.parse.urlparse(self.url)
    filename = os.path.basename(url.path)
    path = os.path.join(d, filename)
    if os.path.exists(path) and not overwrite:
        raise OverwriteError(path)
    with open(path, "wb") as f:
        self.download(f, callback=callback)
    return path