bossanova808 / weather.ozweather

Kodi addon for proper Australian weather data from the BOM
GNU General Public License v3.0
6 stars 3 forks source link

ABC Weather video #9

Closed caitotheonlypotato closed 1 year ago

caitotheonlypotato commented 1 year ago

Hi.

All app functionality works well for me except for ABC Weather video. Since ABC changed their news/weather/sport/business page, the ABC Weather button seems to return an error 16852521211454621469542710055718 .

Kodi 19.4 LibreELEC 10.0.3 (official) RP4b

Regards Greg

bossanova808 commented 1 year ago

Looks like they have shuffled some things around at the ABC. I'll have to keep my eye on it for a few days to see how they're doing it day by day, but will fix it soon...

bossanova808 commented 1 year ago

(have pushed a commit here that fixes it, for today at least, but I am not sure how the URLs will change day to day - once I have the pattern of it, will submit an update to the Kodi repo, but if you know what you're doing feel free to grab the changes and test...my guess is what I have done will keep working, but no way to tell until a few days pass!).

See aeee9ece42a67dfb61b6ddb99e047f2c44e00fcb

caitotheonlypotato commented 1 year ago

The URL from today now seems to be https://mediacore-live-production.akamaized.net/video/01/im/Z/0m.mp4

bossanova808 commented 1 year ago

Yep see the latest commit, that's the one indeed

I have it all working here, just want to check it will keep working before I submit to the repo

Sent on the go... please excuse any typos!


From: Greg @.> Sent: Sunday, May 28, 2023 4:33:06 PM To: bossanova808/weather.ozweather @.> Cc: Jeremy Daalder @.>; Comment @.> Subject: Re: [bossanova808/weather.ozweather] ABC Weather video (Issue #9)

The URL from today now seems to be https://mediacore-live-production.akamaized.net/video/01/im/Z/0m.mp4

— Reply to this email directly, view it on GitHubhttps://github.com/bossanova808/weather.ozweather/issues/9#issuecomment-1565932194, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAFSRLIV672CLVKI43VSVLDXILWSFANCNFSM6AAAAAAYRT2GFU. You are receiving this because you commented.Message ID: @.***>

caitotheonlypotato commented 1 year ago

I can confirm that the commit works for me as at now.

Fantastic !!

caitotheonlypotato commented 1 year ago

Sadly this morning it's broken again, the new URL is https://mediacore-live-production.akamaized.net/video/01/in/Z/cc.mp4

bossanova808 commented 1 year ago

I figured it might break (although why they can't just use a single pointer URL to the current video, I don't really understand...)

Don't worry though, it won't be that hard to work it all out I think.

bossanova808 commented 1 year ago

I suspect this one will keep working, as long as they stick to this general format. https://github.com/bossanova808/weather.ozweather/commit/19f1fbc9e654cee5047ebd2d6164f43460baf7d9

(in a perfect world I'd usd the iView API actually, but they don't appear to have this on there unfortunately...so, scraping it is...)

caitotheonlypotato commented 1 year ago

Awesome, love your work. Confirmed as working for me as at the above change.

bossanova808 commented 1 year ago

Working again this morning (with a new URL again: https://mediacore-live-production.akamaized.net/video/01/io/Z/ea.mp4 )

So I think we're good really. Will test it again tomorrow and if still working, go ahead and submit the update.

(I have take the opportunity to simplify and remove the stream quality options as even this video (supposedly 720p and the best offered) is trivial to stream, so I don't see the point in offering anything any lower in quality)

caitotheonlypotato commented 1 year ago

Yep, the only noteworthy thing for me is that when the file location changes, I do need to hit the refresh button, but that may be something particular to my installation/hardware configuration.

bossanova808 commented 1 year ago

It will fetch the updated video URL automatically on the next weather update, which is triggered by Kodi every ~30 mins (and only when not playing IIRC - so you usually see it clearing and then updating when you go back to the menus).

Not much I can do about that, is a fixed Kodi thing - so yeah, there will be windows where it's not available as a result. Which is kind of annoying, but I don't see a way around it really (at least without a whole lot of work...)

(It was probably always the way with it, to be honest, now I think about it).

The other thing I don't love is how the name of the video changes each time to the two digit code at the end, but again, there's no easy way around that, nor does it really matter.

bossanova808 commented 1 year ago

Still working fine today.

However, I have thought about it, and I wonder if there isn't a better way of tackling this, without _too much extra work, so I might have a bit of a play first and see if I can change how it works so that there aren't any gaps (i.e. it scrapes the current url as you push the button, basically - will mean some milliseconds slower start on the video, but would then always be current...)

Will have a play and see if I can get it working that way, otherwise submit as is...

bossanova808 commented 1 year ago

So that worked out very well indeed...works a treat, and was in fact very simple.

Only thing is it will require me to update the Skin Patcher as well, as it means there needs to be a change to the button (if the skin doesn't get changed, the old way will still work but with the issues above, so best to change the buttons).

I'm going to close this now, as fixed, but look for v2.0.7 coming along shortly..I'll likely submit this afternoon.

(Fixed with https://github.com/bossanova808/weather.ozweather/commit/fdc8da1717c7017e816095e72805867ac6ffafd1)

bossanova808 commented 1 year ago

Unfortunately, this has not stayed fixed - the page we were using to get the weather video turns out not to be a good source, even though the thumb still says Weather in 90 seconds, today it seems to be 27 seconds of grainy footage of a country airport, for reasons I fail to understand - https://www.abc.net.au/news/weather

So...back to the drawing board. It seems this is a better source: https://www.abc.net.au/news/newschannel/news-in-90-seconds

...feels like that might be a more correct home for things. There is a JSON blob on that page from which I can extract the weather url needed.

New commit here: https://github.com/bossanova808/weather.ozweather/commit/4296bd779e1b18c40dba370fff6f9faa74769167

Going to test for a few days, again, before submitting this fix upstream!

caitotheonlypotato commented 1 year ago

OK, yeah it has been a bit hit and miss, although it did play the winter outlook yesterday which was interesting :)

If it gives any further greif, the TV headend FreeView Aust TV addon for Kodi from Matt Huismann seems to always pick up the right file/stream, maybe I can do something with that to help.

The new commit is also working for me

bossanova808 commented 1 year ago

Interesting - the iView addon doesn't list the xxx in 90 seconds stuff....and looking through the source of that on github, I'e looked through the API a bit and can't find links to it :(

I don't think Matt's addons are on github are they? I don't have TVHeadEnd setup and can't be bothered with that - if the URL parsing stuff is at the Kodi end I could look through it obviously...but by the looks of it I have set up Matt's IPTVAU addon at some point - I think that uses his xmltv guides though, so suspect the parsing is all done...somewhere else....?

I suspect this fix will probably stay working, but I'd for sure like a more reliable route...

caitotheonlypotato commented 1 year ago

Is this of any use (from tvheadend)

EXTINF:-1 channel-id="mjh-abc-90-seconds-weather" tvg-id="mjh-abc-90-seconds-weather" tvg-logo="https://live-production.wcms.abc-cdn.net.au/d376e49724862f104d044ff6467f85d8?impolicy=wcms_crop_resize&cropH=630&cropW=1119&xPos=10&yPos=0&width=862&height=485" group-title="Au" ,ABC Weather in 90 Seconds

pipe://ffmpeg -loglevel fatal -probesize 10M -analyzeduration 0 -fpsprobesize 0 -headers user-agent:\ Mozilla/5.0\ (Windows\ NT\ 10.0;\ Win64;\ x64)\ AppleWebKit/537.36\ (KHTML,\ like\ Gecko)\ Chrome/98.0.4758.102\ Safari/537.36\r\nseekable:\ 0\r\nreferer:\ \ \r\n -i https://c.mjh.nz/weather_in_90_seconds -vcodec copy -acodec copy -metadata service_name=mjh-abc-90-seconds-weather -f mpegts pipe:1

bossanova808 commented 1 year ago

Thanks, but not really... but I've actually spoken to Matt and he's doing the same thing I am now doing so I think we're likely to be ok here.

bossanova808 commented 1 year ago

Given Matt confirmed this approach, I've submitted v2.0.9 to the addon repo with this fix.