-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
Auth has list index out of range error #201
Comments
tried some things, now its like this. |
Yo I had this same issue. Revert the "tried some things now its like this" because whatever you did probably made it worse But your problem was that you were copying just the refresh token and pasting it in. you should be copying the ENTIRE URL including the localhost part |
Same issue, this fixed it. Thanks! |
first time auth, this happens.
Traceback (most recent call last): File "C:\Users\polym\OneDrive\Desktop\Programming\newtrdaing\main.py", line 12, in <module> TDSession.login() File "C:\Users\polym\OneDrive\Desktop\Programming\newtrdaing\td\client.py", line 266, in login self.oauth() File "C:\Users\polym\OneDrive\Desktop\Programming\newtrdaing\td\client.py", line 387, in oauth self.exchange_code_for_token( File "C:\Users\polym\OneDrive\Desktop\Programming\newtrdaing\td\client.py", line 410, in exchange_code_for_token url_code = list(url_dict.values())[0][0] IndexError: list index out of range
I have no idea how to fix this. I don't understand how i would be out of range of this 0 index list.
i'm trying the sample code.
`# Import the client
from td.client import TDClient
Create a new session, credentials path is required.
TDSession = TDClient(
client_id='',
redirect_uri='http://localhost',
credentials_path='C:\Users\polym\OneDrive\Desktop\Programming\newtrdaing\td_state.json'
)
Login to the session
TDSession.login()
Grab real-time quotes for 'MSFT' (Microsoft)
msft_quotes = TDSession.get_quotes(instruments=['MSFT'])
Grab real-time quotes for 'AMZN' (Amazon) and 'SQ' (Square)
multiple_quotes = TDSession.get_quotes(instruments=['AMZN','SQ'])`
The text was updated successfully, but these errors were encountered: