Autoconnect now working

I am trying to autoconnect with a piece of code that I found online.
http_session = requests.Session()
url = http_session.get(url=''+ api_key).url
response ='', data={'user_id':user_id, 'password':user_password})
resp_dict = json.loads(response.content)'', data={'user_id':user_id, 'request_id':resp_dict["data"]["request_id"], 'twofa_value':pyotp.TOTP(totp_key).now()})
url = url + "&skip_session=true"
response_url = http_session.get(url=url, allow_redirects=True).url
request_token = parse_qs(urlparse(response_url).query)['request_token'][0]

kite = KiteConnect(api_key=api_key)
data = kite.generate_session(request_token, api_secret=api_secret)
While doing so, I am facing,
KeyError: 'request_token' because the response_url variable doesn't contain it. The response_url is as '**********&api_key=***********&skip_session=true'
I am not sure why request_token is not part of it.

Any help here from fellow traders is appreciated
This discussion has been closed.