Skip to content

[Bug] OAuth Error - How to get access token for private league I don't have access to #62

@brownbrandon272

Description

@brownbrandon272

Description of Issue

Not so much a "bug" as it is an "issue" because docs state that yfpy only works for public leagues or private leagues I have access to. Technically I do have access to this private league; it's just under a different email as my app, which is what I believe is causing my "Developers: Please specify a valid client and submit again." error.

I have a Yahoo Developer app (under email myapp@yahoo.com) and I have a private league (under email personal@yahoo.com). Ideally I would be able to open a browser to log in and authenticate with the email that does have access and return an access token that I can use with YahooFantasySportsQuery. Is there a way that to do with with yfpy (entirely or even partially)?

from decouple import config
from yfpy import YahooFantasySportsQuery

# Initialize YahooFantasySports API object
yahoo = YahooFantasySportsQuery(
    league_id=96231,
    game_code="nba",  # Use "nba" for NBA leagues
    yahoo_consumer_key=config("YAHOO_CONSUMER_KEY"), # Consumer Key from Yahoo Developer App
    yahoo_consumer_secret=config("YAHOO_CONSUMER_SECRET"), # Consumer Key from Yahoo Developer App
)

KeyError: 'access_token'

Additional Information as Applicable

Yahoo Fantasy Sports League ID

96231

Yahoo Fantasy Sports League Privacy

Private

Operating System/Environment

Windows

Other

Yahoo Developer My App: Confidential Client, Read/Write

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions