Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

dws (341)

  (email not shown publicly)

Journal of dws (341)

Monday January 31, 2005
04:53 AM

Bit-scraping Car Talk

[ #22950 ]

One of the high points of the weekend used to be listening to Car Talk while driving. My travel pattern has changed since moving, and I almost always miss the show now. I had rigged up an FM-radio to audio-in connection to let me capture .wav files to burn to CD, but this never seemed to work out quite right, and that was back before I had a USB MP3 player.

Car Talk keeps the most recent show available as a RealAudio feed. Bits. Hm...

Hypothetically, then, and with the help of a co-worker who knows the sekret of getting mplayer installed on Linux (configure yum to point to, import their PGP key, use yum to install mplayer, and then figure out how to download and install the essential codecs), one could threw together a script that scrapes the Car Talk site for links to the ReadAudio files, streams them disk, converts them from .rm to .wav, and finally (via lame) to an .mp3 in a Samba directory named for the week. From there, it would be a quick copy into an MP3 player, and from there to a happier commute.

It would be a slow process (the RealAudio feed seems to be throttled), but that's what a 2 AM cron job is for. The basic incantation for ripping a segment of the show would probably look something like

$rtsp = ... link to real audio stream ...
mplayer -noframedrop -dumpfile tmp.rm \
-dumpstream  $rtsp
mplayer -ao pcm -aofile tmp.wav -vo \
-null -vc dummy --playlist tmp.rm
lame -h -b 128 tmp.wav segment$n.mp3

I'd be surpised if this same recipe didn't apply to lots of interesting feeds.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Last time I checked Car Talk had stopped Real downloads, I'm glad they are back.

    When I wanted to record Hitch Hikers from the Beeb [], I used Realplayer and the vsound [] tool to get wav output that I then converted to Ogg Vorbis. I use Debian, so you just apt-get the right bits and it all works, YMMV.

    -- "It's not magic, it's work..."
  • Do I understand correctly that mplayer can a) play RealAudio files and b) convert those files to .wav format? I haven't looked in a long time, but the last time I checked RA was a proprietary format I couldn't possibly hope to use with free software. I knew they had opened a lot of their code, but I thought the codec was still proprietary.

    J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
  • You'd think NPR et al would just stop being such dicks, and put up the mp3s to download.

    But alas, in the meantime, there is always the scraping.