Archive for August, 2010

Downloading MP3 Audio from NPR Radio

August 15th, 2010

So its been a while between posts, but I thought I’d post this quick how-to that I worked out a few days ago after trying to download Laura Marling’s recent appearance on World Cafe.

I’ve been trying to do this for a while, but as NPR have upgraded their player, many (if not all) guides out there on this topic no longer work. The new player requires the use of an additional API Key to get the MP3 link.

Here’s how to do it:

1) Install both Firefox (or Chrome?) and Firebug

2) load up the initial story page on NPR… something like :

http://www.npr.org/templates/story/story.php?storyId=129026990

3) Click on ‘Listen Now’ at the top of the page, and let the popup open

4) While on the popup window, Open Firebug (F12 on a PC), and click on the ‘Net’ Tab. If firebug doesnt open, either click on the address bar, and press F12 again, or click the little bug icon in the bottom right corner of the popup window.

5) clear your browser cache ( CTRL + SHIFT + DEL). (or else the browser wont bother getting the URL you want)

6) While Firebug is open, reload the page ( F5 )… (this will give us details of all the XML that the flash object requests)

7) On the ‘Net’ Tab, hover your cursor over each entry. Find the URL’s starting with http://api.npr.org. There will be two - one gets the additional information for the page, and one gets the main information. The one you want will have the same id as the initial story page:

The Initial Story URL:
http://www.npr.org/templates/story/story.php?storyId=129026990

the XML URL:
http://api.npr.org/query?id=129026990&mediaId=129002511&fields=show,audio,multimedia,parent,titles,teasers,dates,song,album,product&apiKey=MDAzMzQ2MjAyMDEyMzk4MTU1MDg3ZmM3MQ010

8) Notice the new apiKey field - the XML will not display without a valid apiKey! Open this XML URL in a new Browser tab, and Search for <mp3 type=”mp3″>, and your mp3 link will be below it! It should look something like:

http://pd.npr.org/anon.npr-mp3/npr/wc/2010/08/20100806_wc_01.mp3?orgId=715&topicId=1103&aggIds=100920965,122773665

9) if your having trouble saving it off, open it in a new tab and do Tools > Page Info > Media > Save As…

Its worth noting that if you know the broadcast date, and the name of the show, you could probably work out the links yourself - the first bit is static: http://pd.npr.org/anon.npr-mp3/npr/

The last bit can be worked out from show name (World Cafe) and broadcast date (2010/08/06): wc/2010/08/20100806_wc_01.mp3

enjoy!