~/opt/anaconda3/lib/python3.9/site-packages/yfinance/base.py in get_info(self, proxy)
1473 def get_info(self, proxy=None) -> dict:
1474 self._quote.proxy = proxy
-> 1475 data = self._quote.info
1476 return data
1477
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/scrapers/quote.py in info(self)
93 def info(self) -> dict:
94 if self._info is None:
---> 95 self._scrape(self.proxy)
96 self._scrape_complementary(self.proxy)
97
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/scrapers/quote.py in _scrape(self, proxy)
122
123 # get info and sustainability
--> 124 json_data = self._data.get_json_data_stores(proxy=proxy)
125 try:
126 quote_summary_store = json_data['QuoteSummaryStore']
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/data.py in wrapped(*args, *kwargs)
39 args = tuple([tuple(arg) if isinstance(arg, list) else arg for arg in args])
40 kwargs = {k: tuple(v) if isinstance(v, list) else v for k, v in kwargs.items()}
---> 41 return func(args, **kwargs)
42
43 # copy over the lru_cache extra methods to this wrapper to be able to access them
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/data.py in get_json_data_stores(self, sub_page, proxy)
309
310 # Decrypt!
--> 311 stores = decrypt_cryptojs_aes_stores(data, keys)
312 if stores is None:
313 # Maybe Yahoo returned old format, not encrypted
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/data.py in decrypt_cryptojs_aes_stores(data, keys)
160 pass
161 if not success:
--> 162 raise Exception("yfinance failed to decrypt Yahoo data response")
163
164 decoded_stores = json.loads(plaintext)
Exception: yfinance failed to decrypt Yahoo data response
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/base.py in get_info(self, proxy)
1473 def get_info(self, proxy=None) -> dict:
1474 self._quote.proxy = proxy
-> 1475 data = self._quote.info
1476 return data
1477
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/scrapers/quote.py in info(self)
93 def info(self) -> dict:
94 if self._info is None:
---> 95 self._scrape(self.proxy)
96 self._scrape_complementary(self.proxy)
97
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/scrapers/quote.py in _scrape(self, proxy)
122
123 # get info and sustainability
--> 124 json_data = self._data.get_json_data_stores(proxy=proxy)
125 try:
126 quote_summary_store = json_data['QuoteSummaryStore']
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/data.py in wrapped(*args, *kwargs)
39 args = tuple([tuple(arg) if isinstance(arg, list) else arg for arg in args])
40 kwargs = {k: tuple(v) if isinstance(v, list) else v for k, v in kwargs.items()}
---> 41 return func(args, **kwargs)
42
43 # copy over the lru_cache extra methods to this wrapper to be able to access them
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/data.py in get_json_data_stores(self, sub_page, proxy)
309
310 # Decrypt!
--> 311 stores = decrypt_cryptojs_aes_stores(data, keys)
312 if stores is None:
313 # Maybe Yahoo returned old format, not encrypted
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/data.py in decrypt_cryptojs_aes_stores(data, keys)
160 pass
161 if not success:
--> 162 raise Exception("yfinance failed to decrypt Yahoo data response")
163
164 decoded_stores = json.loads(plaintext)
Exception: yfinance failed to decrypt Yahoo data response
Describe bug
The usual commands and functions to scrape financial data like
don't work any more. After a long time they had been working again. But now it seems Yahoo Finance again found a way to crypt their data.
The error message is:
Exception Traceback (most recent call last) /var/folders/19/tk2pg6pd03q9lr18yl_2d2f00000gp/T/ipykernel_41601/1210614392.py in
----> 1 msft.info
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/ticker.py in info(self) 136 @property 137 def info(self) -> dict: --> 138 return self.get_info() 139 140 @property
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/base.py in get_info(self, proxy) 1473 def get_info(self, proxy=None) -> dict: 1474 self._quote.proxy = proxy -> 1475 data = self._quote.info 1476 return data 1477
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/scrapers/quote.py in info(self) 93 def info(self) -> dict: 94 if self._info is None: ---> 95 self._scrape(self.proxy) 96 self._scrape_complementary(self.proxy) 97
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/scrapers/quote.py in _scrape(self, proxy) 122 123 # get info and sustainability --> 124 json_data = self._data.get_json_data_stores(proxy=proxy) 125 try: 126 quote_summary_store = json_data['QuoteSummaryStore']
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/data.py in wrapped(*args, *kwargs) 39 args = tuple([tuple(arg) if isinstance(arg, list) else arg for arg in args]) 40 kwargs = {k: tuple(v) if isinstance(v, list) else v for k, v in kwargs.items()} ---> 41 return func(args, **kwargs) 42 43 # copy over the lru_cache extra methods to this wrapper to be able to access them
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/data.py in get_json_data_stores(self, sub_page, proxy) 309 310 # Decrypt! --> 311 stores = decrypt_cryptojs_aes_stores(data, keys) 312 if stores is None: 313 # Maybe Yahoo returned old format, not encrypted
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/data.py in decrypt_cryptojs_aes_stores(data, keys) 160 pass 161 if not success: --> 162 raise Exception("yfinance failed to decrypt Yahoo data response") 163 164 decoded_stores = json.loads(plaintext)
Exception: yfinance failed to decrypt Yahoo data response
Simple code that reproduces your problem
Debug log
Exception Traceback (most recent call last) /var/folders/19/tk2pg6pd03q9lr18yl_2d2f00000gp/T/ipykernel_41601/1210614392.py in
----> 1 msft.info
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/ticker.py in info(self) 136 @property 137 def info(self) -> dict: --> 138 return self.get_info() 139 140 @property
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/base.py in get_info(self, proxy) 1473 def get_info(self, proxy=None) -> dict: 1474 self._quote.proxy = proxy -> 1475 data = self._quote.info 1476 return data 1477
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/scrapers/quote.py in info(self) 93 def info(self) -> dict: 94 if self._info is None: ---> 95 self._scrape(self.proxy) 96 self._scrape_complementary(self.proxy) 97
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/scrapers/quote.py in _scrape(self, proxy) 122 123 # get info and sustainability --> 124 json_data = self._data.get_json_data_stores(proxy=proxy) 125 try: 126 quote_summary_store = json_data['QuoteSummaryStore']
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/data.py in wrapped(*args, *kwargs) 39 args = tuple([tuple(arg) if isinstance(arg, list) else arg for arg in args]) 40 kwargs = {k: tuple(v) if isinstance(v, list) else v for k, v in kwargs.items()} ---> 41 return func(args, **kwargs) 42 43 # copy over the lru_cache extra methods to this wrapper to be able to access them
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/data.py in get_json_data_stores(self, sub_page, proxy) 309 310 # Decrypt! --> 311 stores = decrypt_cryptojs_aes_stores(data, keys) 312 if stores is None: 313 # Maybe Yahoo returned old format, not encrypted
~/opt/anaconda3/lib/python3.9/site-packages/yfinance/data.py in decrypt_cryptojs_aes_stores(data, keys) 160 pass 161 if not success: --> 162 raise Exception("yfinance failed to decrypt Yahoo data response") 163 164 decoded_stores = json.loads(plaintext)
Exception: yfinance failed to decrypt Yahoo data response
Bad data proof
No response
yfinance
version0.2.12
Python version
No response
Operating system
No response