-2

There are many posts about this but mine is different. There are a number of mp3 files in a remote server in the internet. I can listen to each music like:

http://www.blahblah.com/demo/A1.mp3

When I use the following command in Mac's terminal, it downloads the file successfully:

ftp http://www.blahblah.com/demp/A1.mp3

but my question is: how can I download all of them? Considering I don't know their names? This is not a ftp server and just a typical website and the mp3 files are not illegal or something they are all demo musics.

ftp command cannot connect anonymously to the website because I don't have username/password obviously.

2
  • Can you establish an FTP connection? Then you could mget *.mp3. The command for that probably ftp www.blahblah.com, username "anonymous" or "ftp" , pass: anything you want, but Your email addresss would be polite. Then use ls and cd to go to the right place on the ftp server and get filename or mget *.mp3.
    – Hennes
    May 9, 2015 at 9:52
  • No that's the problem. I can't establish a ftp session. But whenever I specify the full url and file name it downloads the file.
    – xbmono
    May 9, 2015 at 10:01

1 Answer 1

-1

You can try to use wget and get recursively

wget -r http://www.blahblah.com/demp/

If you can't get the list of directory use something like

wget -r http://www.blahblah.com/demp/mp3.html

where mp3.html is the page where those files are linked

If you have file with URL's you can use for example this way:

for i in `cat filename`;
do
wget $i
done
6
  • with wget I get error saying Forbidden 403. Apparently we can only have access to the files directly not the directory. Can we use wildcards for wget?
    – xbmono
    May 9, 2015 at 9:48
  • This mean you can't get the listing. And w/o listing you can't get the list of all files. But if you start with web page where are provided links to files you can get the described in this page files May 9, 2015 at 9:57
  • the page unfortunately is a flash. Is there a way to get the names from a flash? FYI it's a html page with a flash music player
    – xbmono
    May 9, 2015 at 10:03
  • In such case there is almost no chance to get them other than asking the page author May 9, 2015 at 10:03
  • I just right clicked on the page and where the flash is loaded there is a reference to a file that contains the listing. now is there any way to use the list and wget to download them? It's a long list and very hard to go through one by one and download them
    – xbmono
    May 9, 2015 at 10:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .