sstrickx / yahoofinance-api

Java Client API for Yahoo Finance
MIT License
498 stars 219 forks source link

Time-outs #191

Closed peternees closed 2 years ago

peternees commented 2 years ago

Hi, I get time-outs. Is the Yahoo service (/v7) still working? it is in yhStock.getHistory()

code-monkey-101 commented 2 years ago

Yupp, as of today. It was still working yesterday.

It seems the crumbs (cookie) code is doing a regex match which doesn't return for the given line.

This can happen, when the regex expression is too complex (catastrophic backtracking) but I haven't looked into it any further.

jcz5163 commented 2 years ago

I am also getting time-outs, can confirm this was working yesterday as well.

gbgdeveng commented 2 years ago

same here v8 request runs fine, however

jgoss1074 commented 2 years ago

How do you make v8 requests?

code-monkey-101 commented 2 years ago

This fixes it for me, but I'm not 100% sure it's still doing the same thing. I'm never running into the postFind if-clause, so couldn't test patternInput. But other than that, it seems to work fine again after the changes.

I don't see why you'd need a "(.*)" here at the beginning or end. The group is not even used.

crumbsmanager

peternees commented 2 years ago

Great! Is it possible to push a new version (jar) with this patch?

peternees commented 2 years ago

I tested this, and for me the problem is before. I just can't open the connection (don't even get a time-out, just stalled).

CrumblManager.setCookie() { .. URL request = new URL(YahooFinance.HISTQUOTES2_SCRAPE_URL); RedirectableRequest redirectableRequest = new RedirectableRequest(request, 5); redirectableRequest.setConnectTimeout(YahooFinance.CONNECTION_TIMEOUT); redirectableRequest.setReadTimeout(YahooFinance.CONNECTION_TIMEOUT); URLConnection connection = redirectableRequest.openConnection();

code-monkey-101 commented 2 years ago

@peternees Are you in the US? If not, try using a US VPN.

I know that yahoo redirects to different pages depending on the country, you live in.

peternees commented 2 years ago

Thanks for the suggestion. I am on Google Appengine, so that is US yes. I will try that.

peternees commented 2 years ago

Fixed, the problem was my side. The change of the pattern as suggested by @killerlegs is the only required.

code-monkey-101 commented 2 years ago

@peternees Glad you got it to work!

MartinLiebig commented 2 years ago

Hi All,

Will there be a new version published somewhere or do I need to fork this lib?

BR, Martin

code-monkey-101 commented 2 years ago

It looks like this repository is no longer being updated by the original author. Maybe @sfuhrm can fix this it in his fork ( https://github.com/sfuhrm/yahoofinance-api )

sstrickx commented 2 years ago

Hi all,

Sorry, only just noticed this. I'll do my best to release a fix soon.

sstrickx commented 2 years ago

Fixed in new version: 3.16.0