-
Notifications
You must be signed in to change notification settings - Fork 557
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
Connection Error #94
Comments
I feel like nba website is either having issues or has been changed somehow. Though I'm not using nba_api (still with nba_py scraper), I have a similar connectivity issue that was not there yesterday :( |
Also having this problem with this package and the entirety of stats.nba.com from browser as well. I'm hoping it's a server/maintenance issue. |
I'm getting ConnectionError: ('Connection aborted.', OSError("(10054, 'WSAECONNRESET')",)) since this morning |
Definitely seems to be a server issue. I have scripts independent from nba_api that keep hanging. When using browser some links work while others dont which is really strange. |
Agreed--after fiddling around with the raw API itself (not this wrapper) I realized some endpoints were working, but the majority seem to be down? Hopefully back up soon. |
Hey guys, found a temporary workaround. I realised the endpoints would work if clicked from a browser, so trialed and errored with the headers until I came up with a fix. |
@calebcheng00 is correct. It looks like they changed up the header requirements where you now need to pass in a referrer. You guys can get this temporarily working in your code by having these headers: headers = {
'Host': 'stats.nba.com',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0',
'Accept': 'application/json, text/plain, */*',
'Accept-Language': 'en-US,en;q=0.5',
'Referer': 'https://stats.nba.com/',
'Accept-Encoding': 'gzip, deflate, br',
'Connection': 'keep-alive',
} and passing it into each of your requests as follows: r = CommonPlayerInfo(player_id=2544, headers=headers) |
I am going to work on pushing out a new version this weekend. I have had bad luck these past few weeks where my computer completely crashed requiring a reformat and grad school has me very busy right now. However, this weekend looks good. |
Added updated headers as of v1.1.5. It has been updated on PyPi as well. Go ahead and run Feel free to reopen this issue or create a new one if the issue persists. |
I'm still getting the same error even with the update. |
@galsk87 Can you provide more information in a new ticket? |
If you're using EC2, assigning an IPV6 address to the instance fixed it for
me.
…On Wed, Dec 18, 2019, 8:24 PM Swar Patel ***@***.***> wrote:
@galsk87 <https://github.com/galsk87> Can you provide more information in
a new ticket?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#94?email_source=notifications&email_token=AGA4C2EF5BHYV6MC6GMTFNDQZLELVA5CNFSM4JKN7JMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHIB76I#issuecomment-567287801>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGA4C2BGBSQKWX23QBHX42TQZLELVANCNFSM4JKN7JMA>
.
|
Until today, the issue had not being solved. |
Same issue occurred today. I run this code every day. Ideas? |
Hi, on Mac and going through Chrome browser working in Enthought Canopy environment the following worked for me for January 19, 2020 data ....
Full working data read-in
|
Updapting "User-Agent" and adding 'x-nba-stats-origin' line from @kabariquaye previous response directly into the library (in venv/lib/python3.7/site-packages/nba_api/stats/library/http.py for me) worked for me ! |
@MutzDude when you assigned an ipv6 address, did you have to change anything else in your instance? Or any parameters in your request? Still getting timeouts after assigning an ipv6 address. |
Unable to connect and receiving the error message below.
ReadTimeout: HTTPSConnectionPool(host='stats.nba.com', port=443): Read timed out. (read timeout=30)
The text was updated successfully, but these errors were encountered: