simonhq / asx_sensor

get ASX information in home assistant
3 stars 2 forks source link

Request unsuccessful. Incapsula incident #5

Open chriswalker01 opened 7 months ago

chriswalker01 commented 7 months ago

The ASX appear to be blocking automated/bot traffic to their api.

The app is no longer initializing, with errors similar to below in the logs.

Curl'ing https://www.asx.com.au/asx/share-price-research/company/BHP results in a similar error, while putting the url in a browser returns the expected json.

<html style="height:100%"><head><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"><meta name="format-detection" content="telephone=no"><meta name="viewport" content="initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><script type="text/javascript" src="/_Incapsula_Resource?SWJIYLWA=719d34d31c8e3a6e6fffd425f7e032f3"></script></head><body style="margin:0px;height:100%"><iframe id="main-iframe" src="/_Incapsula_Resource?SWUDNSAI=31&xinfo=11-20811742-0%200NNN%20RT%281707272883470%20260%29%20q%280%20-1%20-1%20-1%29%20r%280%20-1%29%20B12%284%2c315%2c0%29%20U24&incident_id=312001430051042670-103956453604729803&edet=12&cinfo=04000000&rpinfo=0&cts=9HnUVX%2bAbRhesKw%2bPBQlYcJY%2fqoo8pkO%2f4V83xur8xgbgq5I2ySdLdSlyv90WACi&mth=GET" frameborder=0 width="100%" height="100%" marginheight="0px" marginwidth="0px">Request unsuccessful. Incapsula incident ID: 312001430051042670-103956453604729803</iframe></body></html>

Do we need to change the headers or something?

chriswalker01 commented 7 months ago

I've created a fork that uses yfinance as the source instead of asx.com.au. As a result, the attributes that are available have changed, but I included as many of the original ones as I could. https://github.com/chriswalker01/asx_sensor

simonhq commented 7 months ago

Thanks Chris,

That sounds promising, but I don't think you have made your fork public, so I can't see it.

Could you open it up please?

Thanks

Simon.

chriswalker01 commented 7 months ago

It says it's public. Can you try again please?

simonhq commented 7 months ago

Hi Chris,

yes it is there, I must have looked just before you uploaded.

Looks good to me, did you want to do a pull request?

Simon

simonhq commented 6 months ago

Hi Chris,

I copied the code over to my install, added the python library yfinance to my appdaemon load, but when I started it up I get a connection refused from 'fc.yahoo.com' max retries exceeded.

Anything I am doing wrong?

Simon.

chriswalker01 commented 6 months ago

Hey,

Nope, that's all I did.

Mine's working well. [image: image.png]

Where in the world are you? It wouldn't be a regional thing, would it?

What happens if you try to use the yfinance module locally, outside of appdaemon?

Chris

On Mon, Feb 12, 2024 at 9:12 AM simonhq @.***> wrote:

Hi Chris,

I copied the code over to my install, added the python library yfinance to my appdaemon load, but when I started it up I get a connection refused from 'fc.yahoo.com' max retries exceeded.

Anything I am doing wrong?

Simon.

— Reply to this email directly, view it on GitHub https://github.com/simonhq/asx_sensor/issues/5#issuecomment-1937890130, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADMBENXJ373OINS2I5RQASDYTE66FAVCNFSM6AAAAABC5BHD2KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZXHA4TAMJTGA . You are receiving this because you authored the thread.Message ID: @.***>

simonhq commented 4 months ago

Hi Chris,

Sorry, been hectic here, it is not working for me, but if it working for you others may benefit.

I am in Australia, and I keep getting a connection refused error

Simon.