gadicc / node-yahoo-finance2

Unofficial API for Yahoo Finance
https://www.npmjs.com/package/yahoo-finance2
MIT License
373 stars 62 forks source link

Problem fetching quotes, "unsupported redirect" #777

Closed shaneikennedy closed 4 months ago

shaneikennedy commented 4 months ago

Bug Report

Describe the bug

Please consider completing the survey at https://bit.ly/yahoo-finance-api-feedback if you haven't already; for more info see https://github.com/gadicc/node-yahoo-finance2/issues/764#issuecomment-2056623851.
09:38:27.142 Fetching crumb and cookies from https://finance.yahoo.com/quote/AAPL...
09:38:27.361 fetch https://guce.yahoo.com/consent?brandType=nonEu&gcrumb=UjqZDCU&done=https%3A%2F%2Ffinance.yahoo.com%2Fquote%2FAAPL
09:38:27.706 fetch https://consent.yahoo.com/v2/collectConsent?sessionId=3_cc-session_33add8e1-9cbf-429f-b0aa-bc0e5896c57b
09:38:28.093 fetch https://consent.yahoo.com/v2/collectConsent?sessionId=3_cc-session_33add8e1-9cbf-429f-b0aa-bc0e5896c57b
09:38:28.184 fetch https://guce.yahoo.com/copyConsent?sessionId=3_cc-session_33add8e1-9cbf-429f-b0aa-bc0e5896c57b&lang=sv-SE
09:38:28.268 Fetching crumb and cookies from https://finance.yahoo.com/quote/AAPL?guccounter=1...
09:38:28.355 Error: Unsupported redirect to https://finance.yahoo.com/quote/AAPL/, please report.
    at _getCrumb (/Users/shane.kennedy/.config/raycast/extensions/quotes/index.js:27889:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _getCrumb (/Users/shane.kennedy/.config/raycast/extensions/quotes/index.js:27886:16)
09:38:28.355 Error: Unsupported redirect to https://finance.yahoo.com/quote/AAPL/, please report.
    at _getCrumb (/Users/shane.kennedy/.config/raycast/extensions/quotes/index.js:27889:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _getCrumb (/Users/shane.kennedy/.config/raycast/extensions/quotes/index.js:27886

Minimal Reproduction

await yahooFinance.quote('AAPL')

Environment

Browser or Node: Node version (if applicable): 20.12.0 Npm version: 10.5.0 Library version (e.g. 1.10.1): "yahoo-finance2": "^2.11.0"

dinhminhx commented 4 months ago

Same issue here

gadicc commented 4 months ago

:tada: This issue has been resolved in version 2.11.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

gadicc commented 4 months ago

Hey all, thanks for reporting.

I've released a workaround for this. Instead of failing, it will just log and continue, and everything seems to be working fine -- for now. However, it looks like Yahoo are in the middle of some changes and things may well break again soon. So please do report any further breakages.

:pray:

shaneikennedy commented 4 months ago

@gadicc Thanks for this project and constantly going to war with yahoo for us all 🫡

gadicc commented 4 months ago

For sure, my pleasure. Definitely not going to war against Yahoo though 😅 Have made a lot of effort to make sure the library "plays nice" with their services and team, and so far so good 🙏