You are using SmartConnect directly from library. Instead create a login function that logs in with the API key like below

ANGEL_API_KEY = your_API_key
smart_api = SmartConnect(api_key=ANGEL_API_KEY)

and you can use smart_api.ltpData(...)

it'll work. You're welcome.