Skip to content

Conversation

@ForeverZyh
Copy link

As discussed in #1932 , it seems we need to login to apply the filter, so the idea is to add additional cookies to the API. Usage:

yf.Ticker(symbol).get_earnings_dates(add_cookies={
        'T': Your_cookies1,
        'Y': Your_cookies2})

I tested that if we supply T and Y cookies to the requests.get, we can successfully get the desired response.

I asked ChatGPT to see how to get my cookies manually: https://chatgpt.com/share/67453e22-bba0-8013-9d97-b8d320b7e24f in Chrome.

@ValueRaider
Copy link
Collaborator

ValueRaider commented Nov 26, 2024

add_cookies should be higher and pass to data.py. At least up to the Ticker class, and maybe on yfinance itself.

And save it in cache via YfData._save_cookie_basic or a similar function, because manually extracting cookie sounds annoying.

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.

2 participants