node-yahoo-finance2 icon indicating copy to clipboard operation
node-yahoo-finance2 copied to clipboard

Unexpected redirect getting crumb

Open mxmock opened this issue 1 year ago • 2 comments

Bug Report

Describe the bug

Hello, Everything is ok when I run my project on local in docker. When I put the same project on a vps, always with docker, but through intermediate nginx server I have the following error when the lib getting crumb:

Unexpected redirect to https://finance.yahoo.com/quote/AAPL?guccounter=1

I don't know why the request doesn't return the url with collectConsent?sessionId=XXX...

Minimal Reproduction

const response = await yahooFinance.quoteSummary(`${ticker}`, {
      modules: ["assetProfile", "price"],
});

Environment

Browser or Node: Node Node version: 14.17 Npm version: 6.14.15 Library version: 2.7.0

Additional Context

VPS on Hostinger Docker Nginx HTTPS / SSL

mxmock avatar Oct 18 '23 09:10 mxmock

Hey, thanks for the report.

Unfortunately it will be a while until I will have a chance to look at this :(

However, I wanted to let you know that the issue is probably IP / region related. Yahoo handles the cookie / consent process differently based on the IP.

Is your Dev and VPS in the same country? If not, please let me know what country your VPS is in so I can test the Auth flow with a VPN when I have a chance. We'd of course like to handle this flow in all regions.

If they are in the same country, we'll have to look at what else it could be... although used expect almost everything to be identical in the container except routing...

On Wed, 18 Oct 2023, 12:55 Max, @.***> wrote:

Bug Report Describe the bug

Hello, Everything is ok when I run my project on local in docker. When I put the same project on a vps, always with docker, but through intermediate nginx server I have the following error when the lib getting crumb:

Unexpected redirect to https://finance.yahoo.com/quote/AAPL?guccounter=1

I don't know why the request doesn't return the url with collectConsent?sessionId=XXX... Minimal Reproduction

const response = await yahooFinance.quoteSummary(${ticker}, { modules: ["assetProfile", "price"], });

Environment

Browser or Node: Node Node version: 14.17 Npm version: 6.14.15 Library version: 2.7.0 Additional Context

VPS on Hostinger Docker Nginx HTTPS / SSL

— Reply to this email directly, view it on GitHub https://github.com/gadicc/node-yahoo-finance2/issues/695, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC5IGTC5JNKM2T7Y3JC5PTX76RR5AVCNFSM6AAAAAA6FHHKEWVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE2DSMZUGEYTKNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

gadicc avatar Oct 18 '23 10:10 gadicc

Hum ok I see; my VPS was located in France, but after your response I made a transfer to USA, and now it works like a charm !

Thanks !

mxmock avatar Oct 18 '23 16:10 mxmock