Closed matthewkooshad closed 5 years ago
I was able to get it to work for my use after making changes in Robinhood.py.
"login": "https://api.robinhood.com/oauth2/token/"
(Search for "login": "https://api.robinhood.com/api-token-auth/"
)client_id = "c82SH0WZOsabOXGP2sxqcj34FxkvfnWRZBKlBjFS"
after positions = None
if mfa_code: fields = {'password': self.password, 'username': self.username, 'mfa_code': self.mfa_code', grant_type': 'password', 'client_id': self.client_id} else: fields = {'password': self.password, 'username': self.username, 'grant_type': 'password', 'client_id': self.client_id}
self.auth_token = res['token']
to self.auth_token = res['access_token']
self.headers['Authorization'] = 'Token '+self.auth_token
to self.headers['Authorization'] = 'Bearer ' + self.auth_token
If you have any other issues just refer https://github.com/Jamonek/Robinhood/blob/master/Robinhood/Robinhood.py and make changes in your Robinhood.py
Couldn't get code in the 3 bullet to format correctly but just follow the format in existing code.
Merged the fix for this. Thanks for your patience folks.
i removed special characters from my password as i found noted in https://github.com/joshfraser/robinhood-to-csv/issues/5 -- even after doing that, i get the same error as before i changed my password:
Traceback (most recent call last): File "d:\app\robinhood-to-csv\csv-export.py", line 46, in
logged_in = robinhood.login(username=username, password=password)
File "d:\app\robinhood-to-csv\Robinhood.py", line 81, in login
res = res.json()
File "d:\dev\Python37\lib\site-packages\requests\models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "d:\dev\Python37\lib\json__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "d:\dev\Python37\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "d:\dev\Python37\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)