Checkout Ketarin. I've used it for almost 6 years now and love it. You can have it run scripts before or after downloads, has scripting built in and can do just about anything.
https://ketarin.org/forum/announcement/1-ketarin-188-beta/