jugaad-py / jugaad-trader

Unofficial python client for Zerodha

Home Page:https://marketsetup.in/documentation/jugaad-trader/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upstox login not working

rahulmr opened this issue · comments

Describe the bug
Using upstox example not able to login and go further

Code snippet

from jugaad_trader import Upstox
user_id = "123456"
password = "P@ssw0d131"
twofa = "1990"
u = Upstox(user_id, password, twofa)

# Login
u.login()

# Get profile information
profile = u.get_client_info()

Error

python .\jugaad_upstox.py
Traceback (most recent call last):
  File ".\jugaad_upstox.py", line 8, in <module>
    u.login()
  File "D:\Apps\Scoop\apps\python\current\lib\site-packages\jugaad_trader\upstox.py", line 82, in login
    self.loop.run_until_complete(self.connect())
  File "D:\Apps\Scoop\apps\python\current\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "D:\Apps\Scoop\apps\python\current\lib\site-packages\jugaad_trader\upstox.py", line 45, in connect
    j = json.loads(j)
  File "D:\Apps\Scoop\apps\python\current\lib\json\__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "D:\Apps\Scoop\apps\python\current\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "D:\Apps\Scoop\apps\python\current\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)