0

I want to download a mp3 file from an online course. But the file is behind a CGI redirect. The URL is: "http://openmedia.yale.edu/cgi-bin/open_yale/media_downloader.cgi?file=/courses/fall08/chem125/mp3/chem125_01_090308.mp3"

wget returns "no file available for download". I tried curl -L and wget --trust-server-names and wget -content-disposition.

1
  • 2
    I get that same error when visiting the site in my browser.
    – BenjiWiebe
    Feb 23, 2013 at 2:51

1 Answer 1

1

You will need to understand a bit more about what the CGI is doing. If I click on that link, from SuperUser, I get the same message. The problem is not with the CLI per-se, its because the CGI is detecting you are accessing the file directly and it has been setup to block this (my guess anyway). Try to use the wget --referer option to set the referer. If that doesn't work simply iterate constantly making wget more "same-same" as your browser, meaning adding in the user agent and so forth.

Note: I'm assuming this file is not behind some kind of system you need to log into. If it is you probably need to look at a small python script (or similar) to achieve this, although there are some tools if scripting is not your bag.

Note: what you are doing may not be legal depending on the terms of service of the site and the license the file is distributed under.

2
  • If a login is required and a browser cookie is used, it can be easily exported and used with Wget.
    – Karan
    Feb 23, 2013 at 18:14
  • What I am doing is legal and there is no login. The file is an audio recording of a course from Yale. Chem There are about 30 files, one for each class, that I want so I thought to write a script. I am guessing they put the CGI in there to prevent someone like myself from doing what I am trying to do. :( I tried wget --referer=http://oyc.yale.edu/chemistry/chem-125a --user-agent="Chrome 9.5 Gecko 1.7" http://openmedia.yale.edu/cgi-bin/open_yale/media_downloader.cgi?file=/courses/fall08/chem125/mp3/chem125_01_090308.mp3 also and that did not work. Feb 28, 2013 at 19:10

You must log in to answer this question.

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