I think the download URL in EE has changed.
See original GitHub issueThe source code below is the source code I added the status_code code to check. Is there any place to know the information of the download URL? Or does anyone know?
url = "https://earthexplorer.usgs.gov/download/12864/LC81150342020112LGN00/STANDARD/EE" def _download(self, url, output_dir, chunk_size=1024): """Download remote file given its URL.""" with self.session.get(url, stream=True, allow_redirects=True) as r: if r.status_code == 404: raise "404 not found..." file_size = int(r.headers['Content-Length']) Common.Parameter.FileSize = file_size with tqdm(total=file_size, unit_scale=True, unit='B', unit_divisor=1024) as pbar: local_filename = r.headers['Content-Disposition'].split('=')[-1] local_filename = os.path.join(output_dir, local_filename) with open(local_filename, 'wb') as f: for chunk in r.iter_content(chunk_size=chunk_size): if chunk: f.write(chunk) pbar.update(chunk_size) return local_filename
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (5 by maintainers)

Top Related StackOverflow Question
Thanks! v0.8 should fix that
Thank you so very much.
The pylandsat library works perfectly.