landsatxplore icon indicating copy to clipboard operation
landsatxplore copied to clipboard

Update earthexplorer.py

Open jcintasr opened this issue 3 years ago • 8 comments

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.

jcintasr avatar Mar 29 '22 09:03 jcintasr

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

Ahmed-0357 avatar Mar 30 '22 14:03 Ahmed-0357

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.

jcintasr avatar Mar 30 '22 14:03 jcintasr

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

xiaojiujiu999 avatar Mar 31 '22 08:03 xiaojiujiu999

@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] 403 Forbidden

Forbidden

You don't have permission to access this resource.

: 0

Ahmed-0357 avatar Mar 31 '22 08:03 Ahmed-0357

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

jcintasr avatar Mar 31 '22 10:03 jcintasr

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

Ahmed-0357 avatar Apr 02 '22 05:04 Ahmed-0357

thanks @jcintasr your solution works perfectly. mis dieses

felipem775 avatar Apr 07 '22 08:04 felipem775

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 问题?

dengshuaix avatar Jun 14 '22 08:06 dengshuaix