-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I think the download URL in EE has changed. #20
Comments
i think is not a bug ,i user netcore to download ,this url(https://earthexplorer.usgs.gov/download/12864/LC81150342020112LGN00/STANDARD/EE),retrun 404 page not found. |
Thanks for the feedback, could you ever know your download link? I downloaded the material from that link until last month! |
now,i can't download,i not have a function to solve it,so,i'm so sorry. |
If possible, could you please provide a link if there was a notice that USGS' EarthExplorer does not provide a download service? |
Yes the download URLs changed again. They are also depreciating the current API and replacing it with a new one. But the documentation is offline for now. I'm gonna have a look today, thanks for the bug reports! |
It seems that the new download URL is: https://earthexplorer.usgs.gov/download/{dataset_id}/{scene_id}/EE/ with the following dataset IDs: DATASETS = {
"LANDSAT_TM_C1": "5e83d08ee1e2890b",
"LANDSAT_ETM_C1": "5e83a506f72553b6",
"LANDSAT_8_C1": "5e83d0b656b77cf3"
} |
Is this new download URL working for you? I managed to patch the login, but am getting an The landsatxplore scene search does generate an 'Download URL' field for each scene, however when i open it I have to manually press the button on the page in order to generate a download for the needed dataset, not sure how or if I can automate it to parse the button in JS. |
To elaborate more on the issue, this is an error when I try to access from a web browser. In python, in the I have also skipped the |
Hi, Yes, the link was working 3 days ago but it's not the case any more. The URL is now returning JSON data so I think they are in the process of implementing their new M2M (machine-to-machine) API. I am gonna try to get more information. Thanks for the bug reports. Note that you can also use pylandsat which is similar but does not rely on EarthExplorer. |
Thank you so very much. The pylandsat library works perfectly. |
I pushed a new version to pypi (v0.7) that should fix the issue. |
Thank you so much for reflecting my report! I think it's extracted with a double quotation mark (") in the name of the download file
Thanks! |
Thanks! v0.8 should fix that |
The 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
The text was updated successfully, but these errors were encountered: