Skip to content

Conversation

@dhruvan2006
Copy link
Contributor

New Auth class that allows for login functionality by settings cookies.

import yfinance as yf

auth = yf.Auth()
auth.set_login_cookies(os.getenv("COOKIE_T"), os.getenv("COOKIE_Y"))
auth.check_login()
auth.user

Inspired by #2220

Copy link
Contributor

@R5dan R5dan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any way to let the user just put in there username and password and send a request to yahoo to verify?

else:
return False
except Exception as e:
print(f"Error confirming login: {e}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to change this to logging

@ValueRaider
Copy link
Collaborator

Wait for me to review and merge #2216, might make more sense to combine with config.

@ValueRaider
Copy link
Collaborator

ValueRaider commented Apr 1, 2025

I've merged in the start of a config here #2391.

Maybe check_login should be automatic. If check_login is expensive, remember that yfinance can store cookie persistently ...

@Ate329
Copy link

Ate329 commented May 8, 2025

any updates on this?

@dhruvan2006
Copy link
Contributor Author

Will fix today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants