mlbgame icon indicating copy to clipboard operation
mlbgame copied to clipboard

mlbgame.injury() gives AttributeError

Open VeinyAngus opened this issue 3 years ago • 4 comments

Traceback (most recent call last): File "<pyshell#31>", line 1, in <module> mlbgame.injury() File "C:\Users\ME\AppData\Local\Programs\Python\Python38-32\lib\site-packages\mlbgame\__init__.py", line 266, in injury data = mlbgame.info.injury() File "C:\Users\ME\AppData\Local\Programs\Python\Python38-32\lib\site-packages\mlbgame\info.py", line 408, in injury parsed = json.loads(data.read().decode('utf-8')) AttributeError: 'NoneType' object has no attribute 'read'

VeinyAngus avatar Jun 30 '21 18:06 VeinyAngus

I looked at this briefly and think this has to do with MLB's lookup service being deprecated. Using the StatsAPI (which replaced the lookup service) might fix this issue.

Ethan-Park57 avatar Jul 06 '21 20:07 Ethan-Park57

I looked at this briefly and think this has to do with MLB's lookup service being deprecated. Using the StatsAPI (which replaced the lookup service) might fix this issue.

The StatsAPI? Where can I find this?

VeinyAngus avatar Jul 07 '21 06:07 VeinyAngus

I would just look up MLB StatsAPI. I believe you need to request access/make an account, but I don't know if they give it to anyone and everyone. It doesn't hurt to try to get access though.

Ethan-Park57 avatar Jul 07 '21 21:07 Ethan-Park57

I would just look up MLB StatsAPI. I believe you need to request access/make an account, but I don't know if they give it to anyone and everyone. It doesn't hurt to try to get access though.

Thanks

VeinyAngus avatar Jul 07 '21 21:07 VeinyAngus