Skip to content

Commit

Permalink
Refactored session management system to handle cookie and crumbs better.
Browse files Browse the repository at this point in the history
Added fixes for #167, #166, #160.
  • Loading branch information
connorsanders committed Dec 13, 2023
1 parent 80e4e21 commit 8f1c9ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yahoofinancials/etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ def _request_handler(self, url, res_field=""):
for i in range(0, max_retry):
if open_session:
open_session = False
session, crumb = _init_session(None, proxies=self._get_proxy(), timeout=self.timeout)
crumb_url = cur_url + "&crumb=" + str(crumb)
try:
session, crumb = _init_session(None, proxies=self._get_proxy(), timeout=self.timeout)
crumb_url = cur_url + "&crumb=" + str(crumb)
response = urlopener.get_data(session, crumb_url, proxy=self._get_proxy(), timeout=self.timeout)
except:
continue
Expand Down

0 comments on commit 8f1c9ea

Please sign in to comment.