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 https://formulae.brew.sh/api/formula/a52dec.json 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 https://homebrew.bintray.com/bottles/git-2.23.0.mojave.bottle.tar.gz” 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 “https://homebrew.bintray.com/bottles/git-2.23.0.mojave.bottle.tar.gz” 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.