can look for macos downloader scripts in github. I noticed the readme here shares some URLs though I'm not sure if they still work https://github.com/Comp-Labs/Download-macOS
https://github.com/chris1111/Download_Install_macOS could also be another option.
I know I used one of the macos downloaders from github before, I just forget which one though.
Thanks!