-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cookie & crumb to requests. Involves several changes: - fetch cookie & crumb, obviously. - two different cookie strategies - one seems to work better in USA, other better outside. - yfinance auto-detects if one strategy fails, and switches to other strategy. - cookie is stored in persistent cache folder, alongside timezones. Refetched after 24 hours. To have this work well with multithreading (yfinance.download()) requires more changes: - all threads share the same cookie, therefore the same session object. Requires thread-safety ... - converted data class to a singleton with "SingletonMeta": - the first init() call initialises data. - but successive calls update its session object - naughty but necessary. - thread locks to avoid deadlocks and race conditions.
- Loading branch information
1 parent
308e58b
commit 4466e57
Showing
12 changed files
with
805 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.