spilchen / yahoo_fantasy_bot

A bot that can act as a manager in a Yahoo! fantasy league
MIT License
9 stars 3 forks source link

lg.current_week() not working? #3

Open burtk1 opened 3 years ago

burtk1 commented 3 years ago

Hi,

First of all, a big thanks for the script. It's super!

I'm having an issue getting the current week for my league (should be week 1).

Am I doing something wrong or is there something wrong in the code?

from yahoo_oauth import OAuth2 import yahoo_fantasy_api as yfa oauth = OAuth2(None, None, from_file='oauth2.json') gm = yfa.Game(oauth, 'nhl') gm.league_ids(year=2020) lg = gm.to_league('403.l.XXXX') print(lg.current_week())

Output:

[2021-01-18 13:46:51,022 DEBUG] [yahoo_oauth.oauth.__init__] Checking [2021-01-18 13:46:51,022 DEBUG] [yahoo_oauth.oauth.token_is_valid] ELAPSED TIME : 157.46368098258972 [2021-01-18 13:46:51,022 DEBUG] [yahoo_oauth.oauth.token_is_valid] TOKEN IS STILL VALID Traceback (most recent call last): File "/XXX/yfa_app.py", line 12, in <module> print(lg.current_week()) File "/XXX/python/environments/jagr/lib/python3.7/site-packages/yahoo_fantasy_api/league.py", line 225, in current_week self.current_week_cache = int(t.execute('$..current_week[0]')) File "/XXX/python/environments/jagr/lib/python3.7/site-packages/objectpath/core/interpreter.py", line 734, in execute ret = exe(tree) File "/XXX/python/environments/jagr/lib/python3.7/site-packages/objectpath/core/interpreter.py", line 483, in exe return next(fst) StopIteration

spilchen commented 3 years ago

What is the output of lg.yhandler.get_scoreboard_raw(lg.league_id)? It should be JSON output.