uberfastman / yfpy

Python API wrapper for the Yahoo Fantasy Sports public API (supports NFL, NHL, MLB, and NBA).
https://pypi.org/project/yfpy/
GNU General Public License v3.0
163 stars 44 forks source link

Getting "keyerror" when attempting to run quickstart.py #52

Open gameuser1982 opened 5 months ago

gameuser1982 commented 5 months ago

Description of Issue

Please put a longer description of the bug/issue/problem you are encountering here, as well as anything else you think might be relevant or helpful to reproduce the issue.

Additional Information as Applicable

Yahoo Fantasy Sports League ID

215870

Yahoo Fantasy Sports League Privacy

Public

Operating System/Environment

Windows 10

Other

Any other setup/environment/configuration information you might deem potentially relevant.

I generated a Client ID and Client Secret. The docs say this is an optional step and only needed to run if you want to run a Private league, but it seems like providing a Client ID and Client Secret is mandatory so I went ahead and setup a Yahoo Developer Network App anyway since I may need the private league feature down the road anyway.

There is no Application Type section anymore with an "Installed Application" radio button at https://developer.yahoo.com/apps/create/ but there is a "OAuth Client Type" with confidential client and public client. I selected confidential client. I also selected Fantasy Sports and read/write permissions.

When I select this, it generates a Client ID (Consumer Key) and Client Secret (Consumer Secret). I insert this into private.json as well as into quickstart.py

However this throws up an exception:

(py311baseballbot) C:\baseballbot\yfpy>python quickstart/quickstart.py Traceback (most recent call last): File "C:\baseballbot\yfpy\quickstart\quickstart.py", line 264, in consumer_key=os.environ["dj0yJmk9aHFRUnhxUU5yWll5JmQ9WVdrOVZrdzJlRGwxUVZNbWNHbzlNQT09JnM9Y29uc3VtZXJzZWNyZXQmc3Y9MCZ4PWYx"],


  File "<frozen os>", line 679, in __getitem__
KeyError: 'dj0yJmk9aHFRUnhxUU5yWll5JmQ9WVdrOVZrdzJlRGwxUVZNbWNHbzlNQT09JnM9Y29uc3VtZXJzZWNyZXQmc3Y9MCZ4PWYx'
gameuser1982 commented 5 months ago

Also if I create a Yahoo app using the "public client" option instead of the "confidential client" option then it generates a Client ID (Consumer Key) without a Client Secret (Consumer Secret).

Both options generate a key error exception in quickstart.py. What am I missing here?