seemethere / nba_py

Python client for NBA statistics located at stats.nba.com
BSD 3-Clause "New" or "Revised" License
1.06k stars 256 forks source link

My godness! No any response any more! #123

Open huangzhenyu opened 6 years ago

huangzhenyu commented 6 years ago

Today early the code run normally. But become no response any more later! I wait for several hours! No any repsonse from the console. I doubt it is the website block my IP. But to my strange no any response or error print at all!

huangzhenyu commented 6 years ago

Really interesting!I change another HEADER , and it could be worked normally again! Maybe the default have been used by large people all round the world, thus it is blocked by the NBA.com!

GeorgePaul24 commented 6 years ago

What change did you do? Same thing for me... I tried a bunch of VPNs and nothing worked

s4njee commented 6 years ago

Having the same issue here

s4njee commented 6 years ago

confirms it works when you change the user-agent header in init.py

ilakisp commented 6 years ago

i'm a big noob in this, but could you comment how you managed to fix it? I tried changing user agent headers but with no luck.

s4njee commented 6 years ago

I cloned the git repo, changed the line for user_agent in init.py to 'customagent', and then installed the package by doing 'pip install .' inside the git folder with the changed init.py

That's pretty much it.

jrogers239 commented 6 years ago

doesn't fix for me when i change the HEADERS variable to 'customagent'

s4njee commented 6 years ago

It looks like this?

HEADERS = { 'user-agent': ('customheader'), # noqa: E501 'Dnt': ('1'), 'Accept-Encoding': ('gzip, deflate, sdch'), 'Accept-Language': ('en'), 'origin': ('http://stats.nba.com') }

That's literally the only change I made. Make sure you install the package after you edit it too...

jrogers239 commented 6 years ago

thanks! realized part of my problem was working with an older version of the init file, updated to most recent version and fixed the agent. all working again :) thanks for your help!

SpecCRA commented 6 years ago

Will we ever see a fix by @seemethere ?

rneu31 commented 6 years ago

I've tried contacting @seemethere on here and via Twitter with no response. If nothing changes shortly before the NBA season starts back up I will fork it and handle a good amount of these issues. I'm interested in becoming a shared owner of this project so all of that isn't required but we'll see..

bttmly commented 6 years ago

@rneu31 if you fork this project please let me know! I maintain a JS client very similar to this one. I had some ideas about trying to standardize clients across languages using some sort of shared JSON configuration – it'd make maintenance much easier – and I began that work here

We could consider creating a github organization to manage NBA client library projects.

swar commented 6 years ago

@rneu31 and @bttmly

Please let me know if you need any help. I would love to contribute more.

huangzhenyu commented 6 years ago

@GeorgePaul24 Yeah , I change the Header to another one and delete *.pyc files. And it work normally. But now I write a loop to scrape all the player's shot detail type stats, it comes out again. Perhaps , time out and no response. When I rerun the code,it start again, but stop at somewhere different from last time. I try to have a idea to retry the code by itself. And @sw4r @seemethere do you have any idea about it?

huangzhenyu commented 6 years ago

Yeah,Yeah,Yeah! I change to another internet enviroment which have high internet speed. It works!But it is only just as temporary solution for this. And I grap all the 548 players' step back shot stats, really interesting. Now I will enjoy to analyzing it.

swar commented 6 years ago

@rneu31 @bttmly

I just wanted to let you both know that I created a new Python NBA API Client over at swar/nba_api.

Definitely looking forward to hearing any suggestions anyone may have.

bttmly commented 6 years ago

@swar wow, there is a ton in there already! where'd you pull all that data from? this probably already exceeds my nba client template. It would be ideal (to me) if we had a repo that was entirely markdown and JSON (although probably with the setup scripts you have there in python) and could use that in different clients in different programming languages. That way we can have one place that writes the JSON and sets up all the markdown documentation and we can import that elsewhere.

swar commented 6 years ago

@bttmly I pulled as many endpoints as I could find from various NBA API clients as well as the stats.nba.com website. I wanted to have good starting list of endpoints to run my analysis script. Thankfully, this process made creating the documentation and API client much simpler. Similar to what you are accomplishing in nba-client-template. I wanted to ensure that this works so that I can regularly update the API client during the NBA Season or whenever new endpoints are discovered.

I completely agree with having a separate repo with markdown and a json file. Not sure on how the best way to proceed would be. I am open to hearing any thoughts you might have on this as we could potentially use most of the parameter and endpoint documentation I created in nba_api.

martendt commented 6 years ago

Sorry I'm late to the party here, but I've been having the same issue as above. The change to 'user-agent' worked to an extent - it stopped the endless running of the code - but now I get a '400 client error' that stats.nba.com/stats does not exist. And indeed, it doesn't, when I try to go in my browser. Is this package too outdated now?

martendt commented 6 years ago

Aaaand it was a syntax error. I was requesting '2018-2019' instead of '2018-19'. I'll show myself out now.

whichen commented 6 years ago

I tested by using "print(nba_py.Scoreboard(month=2, day=21, year=2015))" But get error: ConnectionError: ('Connection aborted.', OSError("(60, 'ETIMEDOUT')",)) Is this package still working?

liaoyongming commented 5 years ago

It looks like this?

HEADERS = { 'user-agent': ('customheader'), # noqa: E501 'Dnt': ('1'), 'Accept-Encoding': ('gzip, deflate, sdch'), 'Accept-Language': ('en'), 'origin': ('http://stats.nba.com') }

That's literally the only change I made. Make sure you install the package after you edit it too...

谢谢