mattdodge / yahoofantasy

A Python SDK for the Yahoo! Fantasy Sports API
67 stars 19 forks source link

way to authenticate without yahoofantasy login? #48

Open prestonlam53 opened 1 year ago

prestonlam53 commented 1 year ago

Hi,

I'm trying to use a VM to automatically get data at a consistent schedule. I'm having issues logging in to yahoofantasy on the VM because it doesn't have a desktop interface or browser. Is there a way to skip logging in to yahoofantasy via browser and just use some sort of oauth token programatically?

mattdodge commented 1 year ago

AFAIK Yahoo doesn't provide any way to do a purely server-side OAuth authentication. However, what you could do is log in on your local machine, grab your access token and refresh token, and then toss those up onto your headless VM.

The easiest way to do this is probably just by copying the .yahoofantasy file from your local machine to the directory on the remote machine where you run the yahoo fantasy commands. This is the persistence file for the library and contains the tokens needed to authenticate.