diff --git a/landsatxplore/earthexplorer.py b/landsatxplore/earthexplorer.py index 9b39dbb..acbba54 100644 --- a/landsatxplore/earthexplorer.py +++ b/landsatxplore/earthexplorer.py @@ -36,14 +36,11 @@ def _get_tokens(body): """Get `csrf_token` and `__ncforminfo`.""" csrf = re.findall(r'name="csrf" value="(.+?)"', body)[0] - ncform = re.findall(r'name="__ncforminfo" value="(.+?)"', body)[0] if not csrf: raise EarthExplorerError("EE: login failed (csrf token not found).") - if not ncform: - raise EarthExplorerError("EE: login failed (ncforminfo not found).") - return csrf, ncform + return csrf class EarthExplorer(object): @@ -63,12 +60,11 @@ def logged_in(self): def login(self, username, password): """Login to Earth Explorer.""" rsp = self.session.get(EE_LOGIN_URL) - csrf, ncform = _get_tokens(rsp.text) + csrf= _get_tokens(rsp.text) payload = { "username": username, "password": password, - "csrf": csrf, - "__ncforminfo": ncform, + "csrf": csrf } rsp = self.session.post(EE_LOGIN_URL, data=payload, allow_redirects=True)