I am learning python, I am building a small tool to download music files through python. I have two questions.
The following webpage has three download links. http://mp3monkey.net/audiod/147455106/186823954/Zeds_Dead_-Demons_.mp3
If I click on the second one (green), an mp3 file gets downloaded on my computer.
However, that download link points to the following link. http://mp3monkey.net/audio/147455106/186823954/Zeds_Dead_-Demons_.mp3?dl=2
If I try to open that link on a separate tab, it does not work, the webpage says "Hotlink Protection. Visit our Website Directly to Download the Song". What is happening? Why clicking directly on the download button downloads the file while open the same link on a new tab is unable to download it?I was reading the following post How do I download a file over HTTP using Python? This method does not work on the above link. Any idea why?
import urllib
urllib.urlretrieve("second link", "test.mp3")
This downloads a corrupt file of size 11kb.