How to download a URL as a file?

24

14

A website URL has "hidden" some MP3 files by embedding them as Shockwave files, as follows.

<span class="caption"><!-- Odeo player --><embed src="http://odeo.com/flash/audio_player_tiny_gray.swf"quality="high" name="audio_player_tiny_gray" align="middle" allowScriptAccess="always" wmode="transparent" type="application/x-shockwave-flash" flashvars="valid_sample_rate=true external_url=http://podcast.cbc.ca/mp3/sundayeditionstream_20081125_9524.mp3" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></span>

How can I download the files for off-line listening?

I've found two methods:

1. The Stack Overflow Method

Create a new local HTML file with just the links, for example:

<a href="http://podcast.cbc.ca/mp3/sundayeditionstream_20081125_9524.mp3">Sunday Edition 25Nov2008</a>

Open the file in the browser, right click the link and File > Save Link As.

2. The Super User Method

Install the Firefox addin Iget. (Be sure to use the right version for your Firefox version.)

Tools > Downloads > Enter URL in the field.

Are there any other ways?

Michelle

Posted 2009-07-22T22:02:45.637

Reputation: 533

If it's a media file, then on Edge browser (Windows 10) you can right click on the default media player used and select to save the media file (was just trying with an .mp4 file). Maybe the default media players of other modern browsers have similar action at context menu. – George Birbilis – 2017-02-23T15:22:03.483

On safari, hold down option while clicking link. – mk12 – 2009-10-17T23:13:21.093

Shouldnt the title question read "Download a File as or given a URL ?" – Simon – 2012-12-11T16:50:52.303

if i'm making sense to above title query ? – Simon – 2012-12-11T17:35:01.813

3

You can skip creating a local file and just put "http://podcast.cbc.ca/mp3/sundayeditionstream_20081125_9524.mp3" in your address bar.

– hyperslug – 2009-07-22T22:10:00.423

2That would only work providing you didn't have any multimedia plugins active (VLC, WMP etc). – Ehtyar – 2009-07-22T23:21:01.157

Answers

12

On Linux, use 'wget' on the command line:

wget http://podcast.cbc.ca/mp3/sundayeditionstream_20081125_9524.mp3

If you want a similar tool on Windows, you could install wget via Cygwin or use one of the GNU Win32 ports.

On Mac OS X, there's cURL, which appears to have a Windows build.

Joe Holloway

Posted 2009-07-22T22:02:45.637

Reputation: 250

@VincentVancalbergh - It seems that that link for wget is no longer active. I found it on Wayback here: http://web.archive.org/web/20150303131028/http://users.ugent.be/~bpuype/wget/ from 2015-0303. There are more recent captures for that page on Wayback, but they all show a "404 file not found" page was captured. Wget.exe at the page linked above is version 1.11.4, dated February 18 2010. This wget seems to be a port (or perhaps a mirror) of GNU wget. Perhaps a more recent version can be found here: http://www.gnu.org/software/wget/wget.html

– Kevin Fegan – 2016-05-04T01:52:49.600

I selected this as the most correct answer because it addresses multiple operating systems. – Michelle – 2009-08-06T19:34:24.973

What the hell??! I would not google this on Linux/Mac.. – Nils – 2012-02-28T14:58:27.687

I'm repeating this here from a comment by Peter Morgensen down below: There is also a stand-alone wget for Windows (Cygwin is not needed) - so wget can be used from BAT files. A direct download URL is: users.ugent.be/~bpuype/wget/wget.exe – Vincent Vancalbergh – 2012-07-07T19:43:35.470

2@VincentVancalbergh Perfect, I'll just wget that lin... well crap. – Rob – 2012-07-31T19:58:36.083

wgetception! o.O – Vincent Vancalbergh – 2012-08-02T12:55:25.013

4Mac's don't have wget installed by default. It does have curl. – Telemachus – 2009-07-23T00:29:37.923

14

3. The command-line method

Download/install/build wget or similar and download from the commandline:

wget http://some/url

Joey

Posted 2009-07-22T22:02:45.637

Reputation: 36 381

9

I use DownThemAll for this. You can just copy the link, open the manager window and select 'Add URL', assuming it doesn't pick the links up when run normally.

Ehtyar

Posted 2009-07-22T22:02:45.637

Reputation: 561

7

if you have the URLs ready and a vanilla Firefox, you can simply download URLs by pasting them in the download manager. I just tested this with FF v26 and it still works like that. btw jtbandes says, this works in Chrome too.

http://lifehacker.com/5915644/download-any-file-or-web-page-by-pasting-its-url-into-firefoxs-download-window

havin_a_bad_fur_day

Posted 2009-07-22T22:02:45.637

Reputation: 136

6

Here is a way to create a download page on the fly without leaving your browser.

  1. Navigate to the web page (which I'm guessing is http://www.cbc.ca/thesundayedition/ ?).
  2. Type this JavaScript into your address bar:

javascript:document.documentElement.innerHTML.match(/external_url=([^\"]*\.mp3)\"/);document.write('<'+'a href="'+RegExp.$1+'">download<'+'/a>')

bobbymcr

Posted 2009-07-22T22:02:45.637

Reputation: 1 992

4

How about this website: www.downloadurlfile.com?? It creates a download-able link to the URL.

Markus

Posted 2009-07-22T22:02:45.637

Reputation: 29

I just tried it and if failed. Apparently it has problems parsing non-ASCII or other chars. Probably the space character. Stupid browsers turn encoded chars to their actual char value when copying the URL, so my URL had spaces in it. – David Balažic – 2019-03-13T12:55:52.620

3

When using Firefox then you don't need any add-ons. Just go to menu Tools » Page Info (or press Control/Command-I) and select the Media tab. Here you'll see all media (images, video, audio, ...) embedded in the page, including a "Save As..." button.

Arjan

Posted 2009-07-22T22:02:45.637

Reputation: 29 084

1I think the question's intent was different - what if you're just started out with a URL? – Derek Morrison – 2012-01-31T15:14:26.310

@Derek, the Media tab shows all URLs that are embedded in the page one is viewing. One only needs the page URL, not the URLs of all that is embedded, to see that list. – Arjan – 2012-01-31T15:24:34.273

2

Firefox 10.0.2 still can't directly download a URL.

The original asker first method (create HTML file containing <a href="...">link</a>, open in Firefox, right click the link, save as) can be optimized with a bit of javascript like this:

<script type="text/javascript">
var copylink = function(){document.getElementById("thelink").href = document.getElementById("theurl").value}
</script>
<input id="theurl" type="text"/>
<button type="button" onclick="copylink()">Update Link</button>
<a id="thelink" href="">Download Link</a>

This little HTML file can be put to favorite. So the new flow will be:

  • Open this HTML from favorite
  • Copy paste URL to the textbox
  • Click 'Update Link'
  • Right click 'Download Link', Save As

(Or just copy it into a jsFiddle and use it there, for example like this)

Endy Tjahjono

Posted 2009-07-22T22:02:45.637

Reputation: 1 242

1

There's also a plethora of clipboard-monitoring download apps that will start downloading a file when it is copied to the clipboard if you like that sort of thing. I've used FreeDownloadManager in the past.

Ehtyar

Posted 2009-07-22T22:02:45.637

Reputation: 561

1

Using Safari, all you need to do is open the activity window and then click on the file in the list of files. It should then start downloading the file.

If the media opens in a new window and menu File -> Save As is disabled, then I use the following on Mac OS X.

curl -o sundayEdition.mp3 http://podcast.cbc.ca/mp3/sundayeditionstream_20081125_9524.mp3

Bruce McLeod

Posted 2009-07-22T22:02:45.637

Reputation: 5 490

1

The other command line method would be Curl which can also read URLs from a file. Alternatively you can write a higher level script that gets the original page, and parses out the URLs to get individually using something like Perl, Python, Ruby, maybe even JScript, or ZSH.

dlamblin

Posted 2009-07-22T22:02:45.637

Reputation: 9 293

0

I always use the wget application on linux or axel if I know that I won't overload the server with 4 connections and I want it faster. Both are available on windows with Cygwin. If it's on a site which I will scrape often, create a script to extract the URL for me and run similar.

jamuraa

Posted 2009-07-22T22:02:45.637

Reputation: 3 546

1

There is also a stand-alone wget for Windows (Cygwin is not needed) - so wget can be used from BAT files. A direct download URL is: http://users.ugent.be/~bpuype/wget/wget.exe

– Peter Mortensen – 2009-07-29T17:23:30.653

@PeterMortensen - It seems that that link for wget is no longer active. I found it on Wayback here: http://web.archive.org/web/20150303131028/http://users.ugent.be/~bpuype/wget/ from 2015-0303. There are more recent captures for that page on Wayback, but they all show a "404 file not found" page was captured. Wget.exe at the page linked above is version 1.11.4, dated February 18 2010. This wget seems to be a port (or perhaps a mirror) of GNU wget. Perhaps a more recent version can be found here: http://www.gnu.org/software/wget/wget.html

– Kevin Fegan – 2016-05-04T01:56:35.120

0

For Safari, this can be accomplished by pasting the URL into the downloads window.

jtbandes

Posted 2009-07-22T22:02:45.637

Reputation: 8 350

0

If your browser does not support starting a download via a direct URL (such as Safari), you can just copy the URL into the address bar and go File > Save As.

Josh Hunt

Posted 2009-07-22T22:02:45.637

Reputation: 20 095

Nope, as Ehtyar pointed out, the plugins automatically start playing the mp3, with no apparent way to save the file. – Michelle – 2009-07-23T19:41:32.697

It would start playing the song, but you should be able to choose Save As from the file menu. I definitely can. – Josh Hunt – 2009-07-24T02:55:41.703

No, save as is greyed out. However, you can just hold down option, select the address bar and hit enter to download it instead of playing it. – mk12 – 2009-10-18T02:27:31.127

0

First, try visiting the URL in web browser. It should prompt for the download. But, if plug-ins are screwing things up, see below.

Install a download manager like Internet Download Manager and use its add URL option to paste the URL in question. This can download any type of resources reliably.

Apple II

Posted 2009-07-22T22:02:45.637

Reputation: 3 669

0

You can automate the process by using Xidel:

Xidel is a command line tool to download and extract data from HTML/XML pages or JSON-APIs, using CSS, XPath 3.0, XQuery 3.0, JSONiq or pattern templates. It can also create new or transformed XML/HTML/JSON documents.

Xidel is xmllint, jq, curl/wget all wrapped in one. It may not have every single feature the others do have, but it comes pretty close.

Extract the url:

xidel -s "http://yoursite/" -e "//embed/substring-after(@flashvars,'external_url=')"
http://podcast.cbc.ca/mp3/sundayeditionstream_20081125_9524.mp3

or

xidel -s "http://yoursite/" -e "//embed/extract(@flashvars,'http.+')"
http://podcast.cbc.ca/mp3/sundayeditionstream_20081125_9524.mp3

Download the url:

xidel -s "http://yoursite/" -f "//embed/extract(@flashvars,'http.+')" --download .

P.s. These queries use Windows quoting. If you're on Linux be sure to swap " and ':

xidel -s "http://yoursite/" -f '//embed/extract(@flashvars,"http.+")' --download .

Burhan Khalid

Posted 2009-07-22T22:02:45.637

Reputation: 318

-1

Copy and paste URL into Firefox and voila. Instant download. Easiest method by far ; )

user234719

Posted 2009-07-22T22:02:45.637

Reputation: 1