-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NFL league_ids yielding RuntimeError #11
Comments
Hmm, something is weird with that league. You are part of the league but the first team in the league doesn't exist. Are you able to to construct a league object for the league?
|
Is your team key object an array still? I had to concatenate mine into a string like this: def yahoo_login():
print("-- Logging to into Yahoo")
oauth = OAuth2(None, None, from_file='oauth.json')
game = yfa.Game(oauth, 'nfl')
print("-- Logged in to Yahoo")
game_id_array = game.league_ids(year=2020)
game_id_str = ''.join(map(str, game_id_array))
league = yfa.League(oauth, game_id_str)
print("-- Created local Yahoo league to extract info from")
return league So that it would work properly, doesn't look as clean but works! |
@Demon-tk, |
I got a similar error with similar code.
Trying to get leagues for 2024 and it has been working fine until one user got this exception. For other users, it's been working fine.
|
@spilchen - I wonder if some Yahoo users have corrupt data in their accounts? Do you think there's a way for these users to log into their Yahoo accounts and fix the bad data? If so, please let me know. Then I can give this user some instructions on how to resolve it. |
I resolved by querying the Yahoo API directly because I am filtering by NFL and season. One request returns all the league info that I need. |
When attempting to return league_ids with a year specified, a RuntimeError is returned.
Code:
Returns:
I am able to successfully return league information, team information, etc if I manually input the league ID, however it makes it much more difficult to automate the querying of data if I manually need to identify the game ID for the current year (it is 399 for 2020 NFL for example) and league ID.
I also do not recognize the game ID (39), or league ID (15338) being returned in the traceback.
Any thoughts?
The text was updated successfully, but these errors were encountered: