API authorization

def get_login_url(api_key, redirect_url):
    encoded_redirect_url = urllib.parse.quote(redirect_url)
    base_url = "https://api.upstox.com/v2/login/authorization/dialog?response_type=code&"
    payload_url = f"client_id={api_key}&redirect_uri={encoded_redirect_url}"

    return base_url + payload_url

I am using this function to create url for login and then I have to go to browser and login manually, is there any method that I can by pass manual login and directly do it in python

I want to delinks all API connectivity