A friend of mine does a radio show that interests me. Unfortunately, being a late night show (midnight) and interstate, for me to listen to this live would require me being awake at 4am or so. Due to record label copyright permissions, this show is not available as a podcast download -- it's only available for live or delayed streaming. Undeterred, I wanted to automatically grab the stream and make it available on my iPhone for listening when it suited me, while out and about.
This particular stream is served with the Real Time Streaming Protocol, which means all we really need is the LIVE555 openRTSP command line program. With that installed, it's as simple as calling openRTSP with the stream URL:
In this case, the name of the stream is in the format radioshow_YY_MM_DD.mp4. So my script will grab today's stream. First, a shell script named radioshow.sh:
Once I had the file, I wanted to put it in my iTunes library flagged as a podcast. A commandline tool AtomicParsley enables us to set the appropriate MP4 tags so iTunes sees the file as a PodCast. However, AtomicParsley doesn't like the MP4 tags created by openRTSP. To get around this, we can load our file in QuickTime, and then re-export it to MP4. This will now be a file with MP4 tags that AtomicParsley can modify. We can then execute the following command:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>RadioShow</string>
<key>ProgramArguments</key>
<array>
<string>/Users/bed/scripts/RadioShow.app</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>8</integer>
<key>Minute</key>
<integer>0</integer>
<key>Weekday</key>
<integer>5</integer>
</dict>
</dict>
</plist>Mac OS X Hints
http://hints.macworld.com/article.php?story=20081231225344199