Renaming files downloaded from the web automatically for better readability using Python
Today I downloaded an mp3 with url:
http://music.music.com.bd/Music/S/Sumon%20&%20Anila/Ekhon%20Ami/02%20-%20Sumon%20&%20Anila%20-%20Ekhon%20Ami%20[music.com.bd].mp3
So the downloaded file (downloaded with Multiget) has the name:
02%20-%20Sumon%20&%20Anila%20-%20Ekhon%20Ami%20[music.com.bd].mp3
But it’s awesome so I renamed it to:
02 – Sumon & Anila – Ekhon Ami [music.com.bd].mp3
Which looks much prettier. But as I continued to download more mp3s it felt
labourus to rename every single file that I download. So I thought about some
automation script. Batch file (Windows) / Shell script (Linux) would be good
enough but that would require me to manipulate the name string directly to replace
the %20s with spaces. Not a big deal but the name could contain things other
than %20s (spaces) . So a better solution, I thought, would be Python’s url decoder.
Here is a snapshot of the code from my favourite editor IDLE and also a download link to the python source file.
Place the python script in the folder containing your files and double click on the
script to see it at work!

Here is the download link simply_rename.zip




i am gonna show this to my friend, bro
Tobiaszv, bro, let me know what your friend says.