Is it legal to just publish a Python script that downloads mp3 from an external website, being that the action of downloading is not legal? Is there some kind of repercussion?
Depending on the country where you are, this could make you liable for copyright infringement committed by others. And depending on how many people use this script, and how visible it is, it could get you sued, whether you have actually done anything illegal or not. Being sued will cost you lots of money. Being sued successfully can bankrupt you forever.
I would think very careful about what my motivation is to create such a script, what you gain from it, and what you can possibly lose. And in the end, the purpose of this script is to take income away from artists, so is that really what you want to do?