Sunday, April 25, 2010

The gift that keeps on giving

Two years ago, I wrote a program to download the archive of the Thinking Aloud radio program, and put it onto cheap mp3 players from woot. I gave several of these away as Christmas gifts. (This is as close to giving something "handmade" as I'll ever get.)

My sister in law Lisa liked it enough that she requested an update when she finished all the original episodes a few months ago. I had my original code, but BYU changed the format of their archive -- a lot. I ended up having to learn enough lxml to do the job since BeautifulSoup was now puking on something. But I got it done, and started transferring files to Grant via a free Dropbox account, 2GB at a time. (This turned out to be only about 6 months' worth of weekly-ish shows, since they are inexplicably encoded at 320kbps, 10x what you need for a non-musical podcast.)

But, there was a problem: something in the new shows didn't agree with the firmware on the [now] ancient Sansa player I'd given Lisa. It would play a few seconds and then give up. So after weeks of fruitless troubleshooting, Lisa sent me the Sansa with a package of birthday gifts.

I couldn't get the Sansa to play the new files either, but if I re-encoded the files with lame everything just worked. As a bonus, as long as I was re-encoding I could cut the bitrate down to 32kbps and with the addition of a cheap 2GB microsd card, I could fit the entire show archive up to the end of 2009 on it at once.

But first, BYU had changed their archive format again, and I hadn't kept the files that I'd already transferred to Grant. So I rewrote my downloader for the third time.

This is a long way of saying that: I am a pretty awesome brother in law. And, this totally makes up for the flowers on Lisa's birthday being delivered to the wrong address the first time.

P.S. to Lisa: I left the Sansa where Isaac could reach it and he ate the foam off your headphones. So that is why it will be coming back with a different set, than what you sent it with.

P.P.S.: more for my own use than anything else, the magical transcoding invocation was
find . -name "0*" -print0 |xargs -0 -n 1 -P 2 lame -a --vbr-new --abr 32 --lowpass 15.4 --mp3input --quiet

3 comments:

GoodReason said...

Very cool! And I was on that show about a year ago . . .

Jonathan Ellis said...

Those producers really do have good taste in guests, don't they? :)

Unknown said...

You are a wonderful brother-in-law.- Lisa