iPodder Overview

by Andrew Grumet on 23 July, 2005

Download audio files by subscription and have them automatically transferred to your mobile audio player.

For years one of my radio favorites was a program called This American Life (TAL). It airs on my local Public Radio station, once on Saturday and once on Sunday. On a particularly organized weekend I could plan things so that I was driving or working around the house when the program aired. If I missed the Saturday airing, maybe I'd catch it on Sunday. Most of the time I caught only snippets of the show or forgot to listen.

At some point TAL started offering their content for online download from their Web site (http://www.thisamericanlife.org). I had good connectivity in my lab at MIT and, eventually through the magic of broadband, at home. The content was offered as a Real Audio stream, which meant that I had to sit at a computer in order to listen to it. But sitting at a computer usually meant concentrating on writing software or email, which made it hard to concentrate on the audio. And sitting at the computer for the sole purpose of listening to audio didn't work for me, it was just too inefficient.

Back in 2000 I discovered a software program called Voquette Media Manager. This software had some magic blue smoke that allowed it to capture streaming audio in a form that could be burned to CD. With Voquette the tether was cut, and I could enjoy TAL wherever and whenever I pleased. The joy of it! Somewhere in one of my closets there is a spindle holding dozens of these lovingly burned CDs, waiting to be sold on ebaY. The problem was, retrieving audio this way was still pretty labor intensive.

For a number of years the labor-saving alternative was to pay a fee to audible.com (http://audible.com) in exchange for a downloadable version of the program that could be transferred to a mobile audio player such as an Apple iPod.

At the same time, weblog infrastructure was developing. News aggregators and RSS enabled a reader to receive text and images by subscription, simultaneously from many sources. Do-it-yourself publishing, already made easy with home pages, got even easier as blogging tools arrived with their emphasis on streamlined content updating over visual design. Suddenly our friends' blog posts could appear interspersed among stories from the New York Times and the Christian Science Monitor. The news aggregator didn't discriminate -- one RSS feed was as good as the next.

These two infrastructures, weblog syndication and untethered mobile audio, have combined and given birth to the medium now known as podcasting. iPodder is a podcast receiver.

How it works, part 1

To get up and running with iPodder, simply download the Windows, Mac OS X or Linux distribution from http://ipodder.sourceforge.net and install it. iPodder is free software, licensed under the GPL, so the source code is also available. The section on Hacking the hack contains instructions for downloading the source.

Screenshot of
the iPodder directory tab after double-clicking a feed to raise the
Add a Feed dialog.

iPodder enables audio by subscription, so the first thing you'll want to do is add RSS feeds, also known as podcast feeds, to it. The easiest way to do this is to click on the Podcast directory tab in the application. This tab is filled with a number of public directories listing a wide variety of podcasts. To expand one of these directories, click on the directory name. To subscribe to a podcast feed, double-click on the name of the feed, then click the Save button the Add a Feed dialog that pops up.

Podcast feeds may also be added manually by pressing Ctrl-N, or clicking on the Add a new feed button on the Subscriptions tab. This is likely how you'll add most feeds: 1) hear about the podcast from a friend, 2) perform a Web search on the podcast's name, 3) navigate to the podcast homepage, 4) locate the feed link on the podcast homepage (usually accompanied by the words "podcast feed" or "podcast" or "syndication feed" or a white-on-orange XML button), 5) copy the feed link to the clipboard, 6) hit Ctrl-N in iPodder, 7) paste in the feed link, 8) click Save.

Screenshot of
the iPodder scheduler dialog.  iPodder can check for new podcasts at
regular intervals or at specific times.

The second most important task in iPodder is to set the scheduler options. Press Ctrl-L or select Scheduler... from the Tools menu. This will raise a dialog window where you can tell iPodder when it should check for new podcasts on your subscribed feeds. iPodder can check for new podcasts at regular intervals or at specific times that you enter into the dialog. I use the latter option, to ensure that iPodder is checking for new content just before I leave the house in the morning and just before I return home in the evening. That way I've always got the freshest available content when I'm ready to listen to it.

To experience a bit of magic, try this: Select Close window from the File menu, instruct iPodder to continue running in the background, and walk away. Yes, walk away. Okay, technically you don't have to. iPodder has a Check for new podcasts button, and will happily fetch all your new podcasts at the click of a mouse. But do you really want to sit there watching progress bars? Assuming you walked away and let some time elapse, when you return to your machine, iPodder will have fetched a number of podcasts for you, added them to your media library and synced them to your player.

How it works, part 2

Click here to see a screenshot that maps the elements of a podcast RSS feed to the same data displayed in iPodder.

Under the covers, iPodder looks a lot like a desktop news aggregator. But while most news aggregators deal in text and images, iPodder is programmed to detect file attachments, download them and sync them to media management software.

Clicking the thumbnail on the right will take you to an illustration of how iPodder processes RSS syndication feeds. At the top of the diagram is a Web browser view of the syndication feed for OpenPodcast.org (http://openpodcast.org). At the bottom is a screen capture of iPodder displaying the information in this feed. Like a news aggregator, iPodder will display the feed title and item titles. Unlike a news aggregator, iPodder also recognizes the enclosure sub-element of item, which contains information about attached files. In the user interface, iPodder uses the name "episode" for an enclosure, displaying one line per enclosure in the episodes window at lower half of the Subscriptions tab. When a download is initiated, iPodder will download each un-downloaded enclosure whose checkbox is checked, by retrieving the contents at the URL listed in the url attribute of the enclosure element.

Having downloaded the enclosures, iPodder will attempt to add these to media management software if it is available. iPodder supports iTunes and Windows Media Player at the time of this writing (July, 2005). By default iPodder creates a playlist for each feed, named after the feed title, and adds each enclosure from a feed to that feed's playlist. Syncing to mobile audio players is then handled by the media manager, which will typically auto-sync when the player is docked. The downloaded enclosures can also be launched right on the PC by clicking the play icon, which appears as a green circle with a white arrow inside. The play icon is located to the left of each episode title in the episodes and downloads windows.

The code

Click here to see a screenshot of the iPodder code tree as viewed in the Mac OS X Finder.

iPodder is built on a number of platforms. At base it consumes RSS feeds and attached files over HTTP, as described in the previous section. But it's also a cross-platform desktop application, written in Python using the wxPython GUI toolkit . Communication with media managers carried out using COM on Windows, with help from the Python for Windows Extensions, and using AppleScript on Mac OS X.

Clicking on the thumbnail to the right will take you to a screen grab of the iPodder code as viewed in the Mac OS X Finder. I'll provide details on how to download it the next section. For historical reasons, the root folder for the project is named iSpider. The main GUI application resides in the file named iPodderGui.py. The gui folder contains helper code for the GUI, as well as a design file, iPodder.xrc, in which the application windows are laid out using the XRCed tool (http://xrced.sourceforge.net). The ipodder folder is home to the core downloading engine and runtime framework, and this in turn relies on a number of third-party libraries in the contrib sub folder. Climbing back up to the root folder, the gui.py and cli.py files serve wrappers for for the GUI and command-line versions of the program, respectively. Additional folders store icons and buttons (icons_status), images (images), the localization engine (localization), platform-specific build files (osx_packaging, win32), and miscellaneous tools and plugins.

Hacking the hack

Downloading the source code requires that you have CVS installed. Most Unixes, including Mac OS X, either ship with a version of CVS or have one available through package management. Consult your distribution's documentation. On Windows there are a number of CVS programs available. I use the client that runs inside Cygwin (http://www.cygwin.com).

Once installed, running these two CVS commands will download the source code into a folder called iSpider.

$ cvs -d:pserver:anonymous@juicereceiver.cvs.sourceforge.net:/cvsroot/juicerece iver login
$ cvs -d:pserver:anonymous@juicereceiver.cvs.sourceforge.net:/cvsroot/juicerece iver co -P juice

In order to run the application you will also need the Python language (http://www.python.org) and the wxPython GUI toolkit (http://www.wxpython.org). Most Unixes, including Mac OS X, ship with Python, but you will probably need to install wxPython. On Windows you will need to install both Python and wxPython. Also on Windows, you will need to install the Python for Windows extensions (http://starship.python.net/crew/mhammond/win32). No matter what the platform, be sure to install a Unicode-enabled build of wxPython.

Once you've got all of the pieces installed, you're ready to launch the application. Launching the application from the source code will be a different experience than launching a release distribution. To do so, locate the gui.py file in your checkout, and launch python against it by double-clicking, or from the command line like so:

Windows example:
C:\iSpider>C:\Python23\python.exe gui.py

Mac OS X example:
Andrew-Grumets-Computer:~/iSpider aegrumet$ /usr/bin/pythonw gui.py

Linux example:
aegrumet@debian:~/iSpider$ python gui.py
If you've gotten this far, you're ready to hack iPodder! Quit the application, edit the source files in your environment of choice (I use IDLE (http://www.python.org/idle/), and re-launch to see your changes.

As for starting points, if you don't already have an itch to scratch, I suggest exploring iPodder's plugin system. Plugins live in the plugins folder, where they are auto-detected by the application at startup. iPodder ships with a sample plugin residing in the file plugins/description_links.py. This plugin extracts hyperlinks from the episode description and builds a right-click Links sub-menu that opens a browser to them when selected.

Just for fun, I've listed another plugin below. This plugin provides a simple workflow for recommending podcast episodes on GigaDial (http://www.gigadial.net).

import wx, logging
import webbrowser
from urllib import quote_plus
import re

log = logging.getLogger('iPodder')
plugin_name = __name__.split('.')[-1]

class Plugin(object):
    """All plugins define a Plugin class."""

    def __init__(self):
        # Report successful load.
        log.info("Loading plugin: %s" % plugin_name)
        # Stores the enclosure after building the menu entry.
        self.enclosure = None
    
    def hook_download_right_click(self, menu, enclosure):
        """This method is called upon generating the right-click menu
        for downloaded episodes in the Downloads tab."""

        # Add a menu item for this enclosure.
        id = wx.NewId()
        menu.Append(id,"Add to GigaDial")

        # Bind a method to the event.
        wx.EVT_MENU(menu, id, self.launch_browser)

        # Save the enclosure info for when the GUI event fires.
        self.enclosure = enclosure

    def launch_browser(self, event):

        gigadial_url = "http://www.gigadial.net/public/choose-or-create"
        enclosure = self.enclosure

        # Strip HTML tags from description, and trim it down to keep IE happy.
        description = enclosure.description.replace('\s',' ')
        description = description.replace('\r\n',' ')        
        description = re.sub('', '', description)
        description = re.sub('<.*?>', '', description)
        description = description[0:1499]
        
        # Build up the enclosure data into a query argument.
        argspec = [ ("url", enclosure.url), \
                    ("title", enclosure.item_title), \
                    ("feed", enclosure.feed.url), \
                    ("description", description), \
                    ]

        args = "&".join(["%s=%s" % (k, quote_plus(v)) for (k,v) in argspec])

        launch_url = "%s?%s" % (gigadial_url, args)

        # Launch a web browser and hand off to the user.
        webbrowser.open(launch_url)

Click here to
see a screenshot of the 'Add to GigaDial' menu item as displayed in
iPodder.

Drop this code into the plugins directory, say in a file named add_to_gigadial.py, and you should see a new menu option for "Add to GigaDial" when right-clicking episodes on the Downloads tab. Selecting that option will open up a Web browser to GigaDial's "Add to PodStation" page, where you can choose a station to which you will add the episode. Finally you'll land on a confirmation page with all of the information pre-filled, where you can edit it and then click OK to submit the episode.

Whether you hack it or not, we hope you enjoy iPodder! If you have any questions, comments or have code to contribute, feel free to contact us via the iPodder project home page, http://ipodder.sourceforge.net.

More




aegrumet@alum.mit.edu