diff --git a/earthaccess/search.py b/earthaccess/search.py index 0fd8e60b..3fd70684 100644 --- a/earthaccess/search.py +++ b/earthaccess/search.py @@ -491,6 +491,10 @@ def _valid_state(self) -> bool: return True def _is_cloud_hosted(self, granule: Any) -> bool: + """Check if a granule record in CMR advertises "direct access".""" + if "RelatedUrls" not in granule["umm"]: + return False + direct_def = "GET DATA VIA DIRECT ACCESS" for link in granule["umm"]["RelatedUrls"]: if "protected" in link["URL"] or link["Type"] == direct_def: