my apologies. That one isn't updated and doesn't allow custom URLs. Try https://github.com/munki/macadmin-scripts/blob/main/installinstallmacos.py
run it as:
python3 installinstallmacos.py --catalogurl https://swscan.apple.com/content/ca...n-lion-snowleopard-leopard.merged-1.sucatalog
run it as:
python3 installinstallmacos.py --catalogurl https://swscan.apple.com/content/ca...n-lion-snowleopard-leopard.merged-1.sucatalog