You can use
pacman -Sw yourPackage
they will be downloaded to /var/cache/pacman/pkg
use --cachedir if you want to download the package to another folder
and to install them from that folder use:
pacman -U dir/yourPackage1 dir/yourPackage2
You can use
pacman -Sw yourPackage
they will be downloaded to /var/cache/pacman/pkg
use --cachedir if you want to download the package to another folder
and to install them from that folder use:
pacman -U dir/yourPackage1 dir/yourPackage2
Using quasi-msys2 (which I'm the author of), you can do it from an existing MSYS2 installation or from WSL:
git clone https://github.com/holyblackcat/quasi-msys2
cd quasi-msys2
echo MINGW64 >msystem.txt
make get-deps mingw-w64-x86_64-libshout | xargs make cache-download
Where mingw-w64-x86_64-libshout is the package name.
The packages are downloaded to ./cache.
Caveat: it only supports packages prefixed with mingw-??-, not the ones from the MSYS environment. By default the UCRT64 environment is used, but it can be changed by creating/modifying msystem.txt after cloning the repo.
It doesn't use pacman, and will work on other operating systems without MSYS2 installed.