I actually just figured out a way around it: in the url, there's another url, which downloads the file. Remove the rest, and viola! Example:
https://adfoc.us/serve/sitelinks/?id=271228&url=https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.4-45.1.4/forge-1.19.4-45.1.4-installer.jar
https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.4-45.1.4/forge-1.19.4-45.1.4-installer.jar = file. Simply use it for whatever version you're downloading, and there's no reason why it shouldn't work that I can see!