swapniljariwala / nsepy

Python Library to get publicly available data on NSE website ie. stock quotes, historical data, live indices
https://nsepy-xyz.web.app
Other
758 stars 377 forks source link

requests.exceptions.TooManyRedirects: Exceeded 30 redirects #250

Open Jigisuta opened 1 year ago

Jigisuta commented 1 year ago

I also started getting this issue recently, it was working fine last month.

  File "C:\Users\nb\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 166, in resolve_redirects 
    raise TooManyRedirects('Exceeded {} redirects.'.format(self.max_redirects), response=resp)
requests.exceptions.TooManyRedirects: Exceeded 30 redirects.
Code:

bhav_copy = get_price_list(dt=last_trade_date)
#last_trade_date is as the name suggests

I found a solution but I think it has to be implemented in the code of NSEPY, here is the link: https://stackoverflow.com/questions/23651947/python-requests-requests-exceptions-toomanyredirects-exceeded-30-redirects

aaryan-verma commented 1 year ago

Please assign me this issue. I can solve it.

jotinder commented 1 year ago

This has totally broken my code. Requesting to please fix this on urgent basis.

gmmkmtgk commented 1 year ago

this is happening on my side also with any kind of usage of nsepy

C:\Users\gmmke\Desktop\new&information_automation>python infostock.py Traceback (most recent call last): File "C:\Users\gmmke\Desktop\new&information_automation\infostock.py", line 3, in quote = get_quote(symbol) File "C:\Users\gmmke\AppData\Local\Programs\Python\Python310\lib\site-packages\nsepy\live.py", line 56, in get_quote res = quote_eq_url(symbol, series) File "C:\Users\gmmke\AppData\Local\Programs\Python\Python310\lib\site-packages\nsepy\commons.py", line 167, in call return self.session.get(url, params=kwargs, proxies = self.proxy ) File "C:\Users\gmmke\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 555, in get return self.request('GET', url, kwargs) File "C:\Users\gmmke\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 542, in request resp = self.send(prep, send_kwargs) File "C:\Users\gmmke\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 677, in send history = [resp for resp in gen] File "C:\Users\gmmke\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 677, in history = [resp for resp in gen] File "C:\Users\gmmke\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 166, in resolve_redirects raise TooManyRedirects('Exceeded {} redirects.'.format(self.max_redirects), response=resp) requests.exceptions.TooManyRedirects: Exceeded 30 redirects.

C:\Users\gmmke\Desktop\new&information_automation>

manujchandra commented 1 year ago

Hi, I am also facing the same issue. Last few weeks the library stopped working.

suhas2686 commented 1 year ago

I did replace all the Nse old urls (www1.nse.com) with the new urls (www.nse.com). Yet the error continues. Weeding what could be the issue.

tarunteckedge commented 1 year ago

Hi, any updates on this please?

jotinder commented 1 year ago

@swapniljariwala we need your kind attention to this. Can you please acknowledge this issue once, so we know whether to expect a solution to this issue in future or not. It's my humble request, so we can plan accordingly and spend efforts on using an alternate Api, in case with these URL change, it would not be possible to come up with a fix soon enough, which I can totally understand.

Requesting you to kindly just clear your stand on this issue.

Appreciate your efforts that went into making this API which has been a treat to use for many of us, so far.

Regards, Jotinder

prabhakarpandey76 commented 1 year ago

I was using it as well and now it is not working. Seems it is not free anymore. i see in NSE site quite heavy prices for this EOD data. can someone verify as well if this is the case?

it will be very problematic if this will not be free........

alloc7260 commented 1 year ago

Use this insted : NSE-HISTORY-SCRAPER

pratik141 commented 1 year ago

created a new project for New NSE API

https://github.com/pratik141/nsedt

Soon add other APIs also