Local works but Streamlit cloud throws 403 status code for URL request

Hi Team,

I am trying to fetch a zip file object from an URL, which was working till yesterday just fine.

Yesterday I just wanted to change @st.cache to @st.experimental_memo and add an automated memo clearance code, then this issue started. Although now when I remove everything and just try to fetch the response, still it wont work as I get the status code as 403 instead of 200.

This works in local perfectly, only the cloud part is the issue. Periodically it would work but then as soon as I refresh it wont and sometimes if i clear the cache and rerun, it wont work which used to work before. I tried with @st.cache also now and clearing the cache crashes the app and gives back empty Reponses from URL.

Below is the minimal code to recreate the error.

import pandas as pd
import streamlit as st
import requests, zipfile, io,logging

url1="https://www1.nseindia.com/content/historical/DERIVATIVES/2022/OCT/fo31OCT2022bhav.csv.zip"
st.write(url1)
r = requests.post(url1)
st.write(r)
status_code=r.status_code
st.write(status_code)

Hey @Pritish57,

If you’re getting a 403 error, please email support@streamlit.io with your GitHub username. Thanks!