Code Monkey home page Code Monkey logo

Comments (9)

lrauhockey avatar lrauhockey commented on July 28, 2024 1

here is the pull request from yfinance that has fixed the encryption issue - ranaroussi/yfinance#1253

from yahoo_fin.

collinL33T avatar collinL33T commented on July 28, 2024 1

Just move all your stuff to yfinance, this dev gave up on this project already. The module has not been updated in almost 2 yrs. Since the Yahoo API issue occurred last week, yfinance has already issued out 2 patches to remedy the same issue we are requesting to fix right now.

from yahoo_fin.

dkivi avatar dkivi commented on July 28, 2024

Same issue here with for example:

aapl_earnings_hist = si.get_earnings_history("aapl")

from yahoo_fin.

xyzitfinance avatar xyzitfinance commented on July 28, 2024

Hi,

Seems that the issue is not related only to some functions.

Seems that is something in the api response that is coming from Yahoo Finance.

Let's take the following example:

  • in stock_info.py we are having the following function = get_earnings_history .

With the help of _parse_earnings_json(url)**** we retrive information from Yahoo Finance.

image

the problem: is in the api response because key = "stores" is somehow encrypted.

image

In order to figure out if is something related to yahoo_fin (expected to not be since no updates happened) I checked the information in Postman and run an GET URL API:

image

Seems that Yahoo Fin is starting to encrypt some information (maybe I;m wrong).

from yahoo_fin.

garroshub avatar garroshub commented on July 28, 2024

Hi,

Seems that the issue is not related only to some functions.

Seems that is something in the api response that is coming from Yahoo Finance.

Let's take the following example:

  • in stock_info.py we are having the following function = get_earnings_history .

With the help of _parse_earnings_json(url)**** we retrive information from Yahoo Finance.

image

the problem: is in the api response because key = "stores" is somehow encrypted.

image

In order to figure out if is something related to yahoo_fin (expected to not be since no updates happened) I checked the information in Postman and run an GET URL API:

image

Seems that Yahoo Fin is starting to encrypt some information (maybe I;m wrong).

If it is because Yahoo Finance encrypts some information, do you know of any user-side solutions?

from yahoo_fin.

xyzitfinance avatar xyzitfinance commented on July 28, 2024

Nope, but seems that not only yahoo_fin is having this issue.

Maybe to owner of the project is more familiar than me with the Yahoo Finance flow and with python.

from yahoo_fin.

danthings avatar danthings commented on July 28, 2024

Ok, so after some research, indeed the issue is coming from the Yahoo API.

I found that also other people that are using other libraries are having the some issues.

I don t know if is fine to specify the library but somehow they succeed to fix it.

The fix relates to the fact that they are decrypting the information with some AES parser & cipher.

I m not familiar to much with python, but in their cases seems to work and I have no idea if this library is still updated or not

from yahoo_fin.

garroshub avatar garroshub commented on July 28, 2024

Ok, so after some research, indeed the issue is coming from the Yahoo API.

I found that also other people that are using other libraries are having the some issues.

I don t know if is fine to specify the library but somehow they succeed to fix it.

The fix relates to the fact that they are decrypting the information with some AES parser & cipher.

I m not familiar to much with python, but in their cases seems to work and I have no idea if this library is still updated or not

I am not familiar with AES parser and cypher. Perhaps you could provide the links you referenced that address similar issues.

from yahoo_fin.

sonso-1 avatar sonso-1 commented on July 28, 2024

here is the pull request from yfinance that has fixed the encryption issue - ranaroussi/yfinance#1253

I was experiencing the issue when calling get_earnings_for_date(). Found a workaround using a snippet of the fix from yfinance.

Below is the workaround for my use case. This is not a proper fix, only posting it here for real developers to come up with a proper fix and update the yahoo_fin project. Until then, this workaround may work for others as well.

  1. Replace the stock_info.py in your python project (...\Lib\site-packages\yahoo_fin\stock_info.py) with the attached updated version
  2. Install additional python modules to handle the decryption
    import hashlib
    from base64 import b64decode
    from cryptography.hazmat.primitives import padding
    from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes

"changelog"

  • added the import statements above
  • added the function decrypt_cryptojs_aes()
  • modified get_earnings_for_date()
    changed "stores = result['context']['dispatcher']['stores']" to "stores = decrypt_cryptojs_aes(result)"'

stock_info.py.txt

from yahoo_fin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.