How to get only the download url?

I want to write a script to automatically download the software.

I’m not sure what download URL. Do you mean the software URL that homebrew pulls to build things? It’s in the API. See for example

I want to get the download url of the software, because I want to download it with another download tool.

For example, use “aria2” and then use “mv git-2.23.0.mojave.bottle.tar.gz $( Brew --cache -s git) && brew upgrade git”.

But I don’t know how to get the url “” by command.

In my area, some software downloads are slow and even downloads are interrupted, but can be improved by using other download tools. So I want to write a script to automate it.