Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requests.exceptions.TooManyRedirects: Exceeded 30 redirects #250

Open
Jigisuta opened this issue Apr 18, 2023 · 10 comments
Open

requests.exceptions.TooManyRedirects: Exceeded 30 redirects #250

Jigisuta opened this issue Apr 18, 2023 · 10 comments

Comments

@Jigisuta
Copy link

Jigisuta commented Apr 18, 2023

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
Copy link

Please assign me this issue. I can solve it.

@jotinder
Copy link

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

@gmmkmtgk
Copy link

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
Copy link

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

@suhas2686
Copy link

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
Copy link

Hi, any updates on this please?

@jotinder
Copy link

jotinder commented Apr 27, 2023

@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
Copy link

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
Copy link

Use this insted : NSE-HISTORY-SCRAPER

@pratik141
Copy link

created a new project for New NSE API

https://github.com/pratik141/nsedt

Soon add other APIs also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants