nba_py icon indicating copy to clipboard operation
nba_py copied to clipboard

My godness! No any response any more!

Open huangzhenyu opened this issue 6 years ago • 22 comments

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 avatar Jun 14 '18 06:06 huangzhenyu

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!

huangzhenyu avatar Jun 14 '18 08:06 huangzhenyu

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

GeorgePaul24 avatar Jun 14 '18 13:06 GeorgePaul24

Having the same issue here

s4njee avatar Jun 14 '18 18:06 s4njee

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

s4njee avatar Jun 14 '18 18:06 s4njee

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.

ilakisp avatar Jun 14 '18 21:06 ilakisp

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.

s4njee avatar Jun 14 '18 22:06 s4njee

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

jrogers239 avatar Jun 15 '18 00:06 jrogers239

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...

s4njee avatar Jun 15 '18 00:06 s4njee

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!

jrogers239 avatar Jun 16 '18 00:06 jrogers239

Will we ever see a fix by @seemethere ?

SpecCRA avatar Jun 18 '18 12:06 SpecCRA

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..

rneu31 avatar Jun 18 '18 17:06 rneu31

@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.

bttmly avatar Jun 18 '18 17:06 bttmly

@rneu31 and @bttmly

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

swar avatar Jun 18 '18 18:06 swar

@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 avatar Jun 19 '18 15:06 huangzhenyu

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.

huangzhenyu avatar Jun 20 '18 03:06 huangzhenyu

@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.

swar avatar Sep 17 '18 03:09 swar

@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.

bttmly avatar Sep 18 '18 17:09 bttmly

@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.

swar avatar Sep 18 '18 22:09 swar

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 avatar Oct 06 '18 22:10 martendt

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

martendt avatar Oct 06 '18 23:10 martendt

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?

whichen avatar Nov 21 '18 08:11 whichen

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...

谢谢

liaoyongming avatar Dec 10 '18 06:12 liaoyongming