easysnowdata.providers.earthdata.download_with_password#
- easysnowdata.providers.earthdata.download_with_password(url: str, subdir: str, *, valid: Callable[[Path], bool] | None = None, timeout: float = 120) Path[source]#
Download one file from a server that refuses a bearer token.
NSIDC’s on-premises
daacdatatree answers a token-only request with the URS login page and HTTP 200, whichearthaccess.downloadsaves as if it were the file. This goes throughpassword_session()instead, so the username and password are used even whenEARTHDATA_TOKENis also set.The file lands in
<cache>/<subdir>and is reused on the next call. A cached file that fails valid, such as a login page an older version saved, is fetched again. A 404 raisesFileNotFoundError; a download that ends on URS, or that fails valid, raises instead of being cached.