cwendt94 / espn-api

ESPN Fantasy API! (Football, Basketball)
MIT License
613 stars 198 forks source link

Update to fix 2018 API issues #514

Open Robert-litts opened 9 months ago

Robert-litts commented 9 months ago

As referenced in #278 (and duplicate issue #466), the 2018 season of fantasy football was getting an "Access Denied" error when attempting to access data. As documented in the troubleshooting steps I made in #278, I found that JSON key values for that year were returning an overarching [0] key that is not present in other years. Edits to the following files were made to account for the changes:

espn_api/base_league.py
espn_api/football/league.py
espn_api/requests/espn_requests.py

These changes ensure that the JSON [0] key is handled appropriately for 2018 league data pulls.

Please let me know if there is any other testing you'd like completed. I only tested this with my fantasy football league (years 2013-2021) and had no errors. I don't have any other sports to test with but didn't see any obvious issues with other sports based on my changes in reviewing the code.

cwendt94 commented 9 months ago

I will test this out on my 2018 league. Weird that it was not happening for all 2018 leagues but only some.