jtpavlock / nbapy

Python API for stats.nba.com
BSD 3-Clause "New" or "Revised" License
11 stars 4 forks source link

Running Box Score example #3

Closed awx1 closed 4 years ago

awx1 commented 4 years ago

When executing pd.DataFrame(game.BoxScore(game_id).players_stats()) there seems to be an exceptionally long execution time with no output. Is this package still useable?

jtpavlock commented 4 years ago

Hey @awx1 thanks for reporting! It's been a couple months since I've last used it, but nba.com is notorious for changing their api without warning. Ill see if I can take a peek at what's going on later today

awx1 commented 4 years ago

I think this might help. I switched to another package to use but https://github.com/swar/nba_api/issues/124

For the other package I was using, the headers was

HEADERS = {'Host': 'stats.nba.com', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0', 'Accept': 'application/json, text/plain, /', 'Accept-Language': 'en-US,en;q=0.5', 'Accept-Encoding': 'gzip, deflate, br', 'x-nba-stats-origin': 'stats', 'x-nba-stats-token': 'true', 'Connection': 'keep-alive', 'Referer': 'https://stats.nba.com/', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache'}

jtpavlock commented 4 years ago

Awesome, thanks for the heads up.

jtpavlock commented 4 years ago

Fixed with https://github.com/jtpavlock/nbapy/commit/4a985cd40733538da1f8cc9004cc55d21115f5a4