Comments (11)
@austinbeauch I've implemented a fix for this issue you've found in v4.1.1, in #23. Now when retrieving all players, if it fails on one of the requests it will attempt to individually retrieve all players in that request and simply skip failed players, and log the failures. Give it a whirl and see how it works for you. If any other problems arise regarding this, just reopen this issue.
from yfpy.
Hmm. A few thoughts pop out @austinbeauch… first, unless you intentionally censored your league ID, then that request URL will fail with the asterisks.
However if that was just you, I will say that I only just updated the functionality to iterate through all players 25 at a time and retrieve them all, as I’d been missing that before. I tested it but it’s possible something about an end condition where it gets to the last players is not catching and stopping correctly.
What fantasy sport are you retrieving players for?
from yfpy.
Thank for the speedy reply @uberfastman! That was indeed me who censored the league id. This is for hockey. I'm on the most recent version as well. It's weird because it's been working fine until last night/today. Could be more players were added to the league and it's creating a new edge case.
I know you developed this mainly focusing on NFL. If this seems to be NHL specific right now I can try and see what's causing it later day, just wanted to see if I was alone in experiencing this or not!
from yfpy.
No problem @austinbeauch, I’ll test it later on in one of my old hockey leagues and see if I can reproduce it. I definitely only tested the new functionality for NFL, but there’s no reason it shouldn’t work for NHL/NBA/MLB.
from yfpy.
Just a quick update as I'm working through this: this appears to not be an issue with some sort of end-of-list case. For whatever reason it's only at start=1425 that it throws an error. Skipping to start=1450 works. Something wonky is going on in that call. Something tells me that this is more an issue on Yahoo's end. I'll keep looking
from yfpy.
Yep, looks like Yahoo is getting upset that one of its own players "doesn't exist"
'Player key 411.p.8205 does not exist.'
Is the description of the returned response. Rather strange, considering he does exist, but not on the website players list.
When sorting all players available, it'll put plays with equal points in chronological order of their ID's. So everyone with zero points is sorted by increasing ID until the players with negative points. Viel hasn't played this year and should have zero points, but Kristians Rubins has an ID of 8191, so Viel at 8205 should come after, but he's absent from the list. However Viel does exist if you search him up manually.
Something strange is going on with Yahoo's API, Viel is somehow dropped from their list of players. I'm not sure exactly what the best way of handling this would be, since an easy solution would be to just ignore those 25 players, but it's possible someone important exists there. Could be worth it to contact Yahoo? Looks like they have an active rep on Reddit, u/YahooFantasyCare, that can report bugs to the engineering teams.
from yfpy.
Wow thanks @austinbeauch you did all the hard work for me! I was just getting on to take a look at this (I was traveling yesterday), and here you've already discovered the issue! Unfortunately the is not the first time Yahoo's API has had some questionable issues... I've been working with it for like 7 years and it's always been a mess.
Anyway, I'm gonna take a look at the player response for that particular request and see if I can implement some sort of error handling for this annoying edge case that will then retrieve all players that DO exist within that 25 player block and ignore failures.
from yfpy.
Kind of a similar issue, however I believe mine is an expired token issue.
What I'm trying to do is run the test_get_league_scoreboard_by_week() function on a thread in order to push live updates (every 30 sec) to a led matrix. So far it works flawlessly for about an hour and then 401 errors repeating. I restart the code and everything runs as it should for another hour until I hit 401's again. Looked into this in YF api documentation and it checks out that the token expires every hour.
Any thoughts on how I could code a refresh into the 401 error try/except portion? Or any thoughts in general on getting around this?
from yfpy.
@Pensfan66 if you don't mind, could you open a separate issue for the token refresh? That seems like a reasonable update to make, but just for the sake of keeping things somewhat organized I'd appreciate having a separate thread for it.
from yfpy.
Looks like it's working, thanks a ton for your effort!!
from yfpy.
@austinbeauch fantastic, glad we got it sorted! You did the hard leg work figuring it out after all, I just had to implement the workaround haha.
from yfpy.
Related Issues (20)
- Error Importing YFPY packages: 'type' object is not subscriptable HOT 4
- Typing inconsistencies HOT 4
- Unexpected TypeError HOT 2
- Clean up returned data structures
- 'all_output_as_json=True ' in query object prevents access to its own methods HOT 2
- Support for retrieving complete player stats HOT 1
- EXAMPLE.private.json Location HOT 2
- AttributeError: 'OAuth2' object has no attribute 'consumer_key' HOT 7
- Request: get_league_transactions() Waiver FAB bids and Trade draft picks HOT 1
- Running it in a container HOT 1
- [Bug] "get_team_roster_player_stats_by_week" returns player stats for a single day, not week HOT 1
- [Bug] function attribute not working correctly get_game_metadata_by_game_id(game_id).game_key HOT 6
- Yahoo Fantasy API Potential Rate Limits HOT 6
- Getting "keyerror" when attempting to run quickstart.py HOT 1
- [Feature Request] Get weekly league standings
- [Bug] Team key does not exist (for a league I'm not even in...)
- New player stats data field?
- [Feature Request] Possible to add ownership percentage by date?
- Learning oppurtunity
- [Feature Request] Team Stats for Season for H2H League with Categories HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yfpy.