I am facing a similar issue. Running it for a single entry works fine but inside a loop, it gives the following error.
kiteconnect.exceptions.DataException: Unknown Content-Type (text/html) with response: (b"504 Gateway Time-out\nThe server didn't r…