Site contents
<html>
<body>
<a href="http://www.sagar.com/" title="sagar">Sagar</a>
<a href="http://www.sagarcom/1/" title="sagar1">Sagar Link1</a>
<a href="http://www.sagar.com/2/song.mp3">Download this</a>
</body>
</html>
link_source_file.txt
contains url for the above content
## Below wget command
wget -r -l1 -H -t1 -nd -N -np -A.mp3 -erobots=off -i link_source_file.txt
I want to download a specific type of file as mentioned by -A. Here it is mp3
. The above wget command it will go till one depth of the link as per -t1
.
It follows the first link http://www.sagar.com/
and downloads the index.html
file. Then figures out that doesn't have any file type as .mp3
then it removes index.html
I want wget to follow only links which have a extension of *.mp3
and not any other links. How can I tweak the command for this requirement?
wget
downloadssong.mp3
for me with the command you gave. Isn't that what you wanted?pavuk
may be a suitable alternative towget
if you want to do more advanced matching on URLs.