FFMPEG camera with variable input link

I’m using the FFMPEG Camera integration to display a public live webcam on my dashboard.

camera:
  - platform: ffmpeg
    input: https://hddn01.skylinewebcams.com/live.m3u8?a=060p4ng6jfgc65o3ajd73ask41

This works great for an hour or two, the thing is, the provider of the feed changes the URL, the “a” query parameter to be precise once in a while, to force people to see the feed from their website and not directly using the stream link.

I’m very new to HA, but an experienced developer, so I can manage to create some kind of script that parses the webcam provider site to get the new “a” parameter a create the new URL every time the old link goes into 404. The problem is, I have no idea how can I integrate this in HA.

Any suggestions?