I was wondering if there is a way to get streamlink to automatically record a stream while I am away from the computer. I'm using streamlink on Windows 10, and the stream isn't from a popular streaming site (twitch, youtube, etc.). It is a local football game that the team streams on their website. The website needs a login but not a subscription.
I've tried creating a .bat file and using task scheduler to run it at a specified time and start recording once the stream goes live. But streamlink can't find the URL because the stream isn't live when I schedule the task, so (I assume) the .m3u8 URL I extracted from by browser is probably a placeholder?
I get a 404 error when running the script.
Here is the code I'm running:
@echo off
streamlink --max-duration 10800 --retry-streams 60 --retry-open 30 --http-cookie "session_id=MYSESSION" --http-header "User-Agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:152.0) Gecko/20100101 Firefox/152.0" "hls://https://cdn-cloudfront.eu-central-1.prod.ingest.aws-infra.dacast.com/live/e412eb88-e205-a450-ad31-5c931c4a6e06/master.m3u8" best -o "C:\FILEPATH\football_match.ts"
exit
I've tried asking AI but it wasn't super helpful. It keeps asking me to extract the master.m3u8 URL when the stream is live, which defeats the purpose since I won't be at my computer and I have to schedule it ahead of time. I'm not very familiar with bash so I may be making a basic mistake.
If instead I just put in the website URL instead of the master.m3u8 URL will that automatically fetch any stream on that website? The stream is embedded in the page, and the website URL is generic. This is the actual website - https://www.realbedford.com/live-stream/watch
Is what I'm trying to do even possible? I guess my logic is why wouldn't a piece of code be able to go to a specific webpage I point it to and find an embedded stream and record that whatever the underlying URL is?