Skip to content
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

Update earthexplorer.py #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jcintasr
Copy link

@jcintasr jcintasr commented Mar 29, 2022

Hello,
today I realised the EarthExplorer module just stop working. I researched a bit and found out the ncform value is not anymore in the request. I just commented out the variable ncform and seems to work again.

If you need more information about the issue, just let me know.

ncform variable commented out
@Ahmed-0357
Copy link

thanks for bringing it out, I am facing the same issue. When I implemented your solution unfortunately still did not work for me.

@jcintasr
Copy link
Author

jcintasr commented Mar 30, 2022

Hi @Ahmed-0357
I checked a script I have downloading information (with my modified version) and it still works. What error do you get? For me it was an IndexError pointing to the ncform variable.

@xiaojiujiu999
Copy link

Oh, thanks a lot!
I meet the same question and it has been solved by using your modified version!

@Ahmed-0357
Copy link

@jcintasr I am getting this error

Traceback (most recent call last):
File "C:\Users\User\anaconda3\envs\rsdatacoll\lib\site-packages\requests\models.py", line 910, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\User\anaconda3\envs\rsdatacoll\lib\json_init_.py", line 354, in loads
return _default_decoder.decode(s)
File "C:\Users\User\anaconda3\envs\rsdatacoll\lib\json\decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\User\anaconda3\envs\rsdatacoll\lib\json\decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\User\anaconda3\envs\rsdatacoll\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Users\User\anaconda3\envs\rsdatacoll\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\User\anaconda3\envs\rsdatacoll\Scripts\landsatxplore.exe_main
.py", line 7, in
File "C:\Users\User\anaconda3\envs\rsdatacoll\lib\site-packages\click\core.py", line 1128, in call
return self.main(*args, **kwargs)
File "C:\Users\User\anaconda3\envs\rsdatacoll\lib\site-packages\click\core.py", line 1053, in main
rv = self.invoke(ctx)
File "C:\Users\User\anaconda3\envs\rsdatacoll\lib\site-packages\click\core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\User\anaconda3\envs\rsdatacoll\lib\site-packages\click\core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\User\anaconda3\envs\rsdatacoll\lib\site-packages\click\core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "C:\Users\User\anaconda3\envs\rsdatacoll\lib\site-packages\landsatxplore\cli.py", line 98, in download
ee = EarthExplorer(username, password)
File "C:\Users\User\anaconda3\envs\rsdatacoll\lib\site-packages\landsatxplore\earthexplorer.py", line 46, in init
self.api = API(username, password)
File "C:\Users\User\anaconda3\envs\rsdatacoll\lib\site-packages\landsatxplore\api.py", line 28, in init
self.key = self.login(username, password)
File "C:\Users\User\anaconda3\envs\rsdatacoll\lib\site-packages\landsatxplore\api.py", line 48, in login
response = requests.post(self.endpoint + 'login?', data=data).json()
File "C:\Users\User\anaconda3\envs\rsdatacoll\lib\site-packages\requests\models.py", line 917, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: [Errno Expecting value]

<title>403 Forbidden</title>

Forbidden

You don't have permission to access this resource.

: 0

@jcintasr
Copy link
Author

@Ahmed-0357 I think your problem is another one. Try to open an issue and check if someone solves it.

@Ahmed-0357
Copy link

@jcintasr yes it works for me now ... much appreciated your help

@felipem775
Copy link

felipem775 commented Apr 7, 2022

thanks @jcintasr your solution works perfectly. mis dieses

@dengshuaix
Copy link

Oh, thanks a lot! I meet the same question and it has been solved by using your modified version!

Oh, How did you fix this ncform problem?

Oh, 你是如何修改这个 ncform 问题?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants