Facing issue in below code

JRoy
Hello Team,

I am trying to run this code, it was working till last Friday, but since today morning I am getting the below error.
==========
Connection error: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (403 - Forbidden))
Connection closed: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (403 - Forbidden))
Connection error: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (403 - Forbidden))
Connection closed: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (403 - Forbidden))
================

import timer
from kiteconnect import KiteConnect
import time
from kiteconnect import KiteTicker
import kiteSettings
import datetime

# Initialise
print(kiteSettings.access_token)
kws = KiteTicker(kiteSettings.api_key, kiteSettings.access_token)

tokens = [63634951,61512711]
dict = {63634951: 'CRUDEOIL23APRFUT',61512711: 'GOLD23APRFUT'}


def on_ticks(ws, ticks):
#if datetime.datetime.now().minute % 1 == 0:
#time.sleep(10)
ticks = [dict[ticks[0]['instrument_token']], ticks[0]['exchange_timestamp'],ticks[0]['last_price'],ticks]
print(ticks)


def on_connect(ws, response):
ws.subscribe(tokens)
ws.set_mode(ws.MODE_FULL, tokens)


kws.on_ticks = on_ticks
kws.on_connect = on_connect
kws.connect(threaded=True)

count=0
while True:
count+=1
if(count%2==0):
if kws.is_connected():
kws.set_mode(kws.MODE_FULL,tokens)
else:
if kws.is_connected():
kws.set_mode(kws.MODE_FULL,tokens)
time.sleep(0.350)

I have generated today's access token through kite url page (https://kite.zerodha.com/connect/login?v=3&api_key=xxx), but no luck. Could you please me know the issue.

Regards,
Joyita
This discussion has been closed.