diff --git a/landsat/downloader.py b/landsat/downloader.py index c10f8cc..94c20c8 100644 --- a/landsat/downloader.py +++ b/landsat/downloader.py @@ -96,12 +96,14 @@ def usgs_eros(self, scene, path): error_text = error_tree.find("SOAP-ENV:Body/SOAP-ENV:Fault/faultstring", api.NAMESPACES).text raise USGSInventoryAccessMissing(error_text) - download_url = api.download('LANDSAT_8', 'EE', [scene], api_key=api_key) - if download_url: - self.output('Source: USGS EarthExplorer', normal=True, arrow=True) - return self.fetch(download_url[0], path) + response = api.download('LANDSAT_8_C1', 'EE', [scene], api_key=api_key) + try: + download_url = response['data'][0] + except IndexError: + raise RemoteFileDoesntExist('%s is not available on AWS S3, Google or USGS Earth Explorer' % scene) + self.output('Source: USGS EarthExplorer', normal=True, arrow=True) + return self.fetch(download_url, path) - raise RemoteFileDoesntExist('%s is not available on AWS S3, Google or USGS Earth Explorer' % scene) raise RemoteFileDoesntExist('%s is not available on AWS S3 or Google Storage' % scene) def google_storage(self, scene, path): diff --git a/requirements.txt b/requirements.txt index 7a40899..d3b906b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -usgs==0.1.9 +usgs>=0.2.0 requests==2.7.0 python-dateutil==2.5.1 numpy==1.10.4