Podcast Management Scripts for iTunes

This page contains scripts designed to help you manage your iTunes podcast subscriptions, right from your iPod, without having to remember which episode of a given podcast you wanted to delete or save for later. The recommended version requires iTunes 4.9; however, an older version of the script is still available for those using iTunes 4.8 or earlier. Both versions require an Apple computer running OS X, and have been tested on a 12-inch PowerBook running OS X 10.3.

Contents

  1. Background
  2. Expire Podcasts 2.0 (Recommended; requires iTunes 4.9 or later.)
  3. Expire Podcasts 1.0 (For iTunes 4.8 and earlier)
  4. Technical Notes
  5. FAQ

Background

With iTunes version 4.9, Apple has integrated support for podcasts into its popular digital jukebox and music store. Right out of the box, the podcast functionality is impressive: you can drag RSS feeds from Safari into iTunes to subscribe or browse a huge directory of podcasts right in iTunes; schedule hourly, daily, or weekly updates; automatically download all episodes or just the most recent one; and synchronize only the podcasts you specify to your iPod. Additionally, you can set iTunes to keep only the most recent few episodes, or to delete episodes after you’ve listened to them.

This last feature was particularly interesting to me, because when I first started listening to podcasts I wrote a script to manage podcasts in a similar way. The difference is that in addition to play count, my script used ratings to determine whether I wanted to keep or delete an episode. I used this feature a lot with, for example, the IT Conversations podcast, of which some episodes fascinated me to no end and others bored me to tears.

iTunes 4.9 has the play count part of that script built in, but not the ratings-based management part. I decided to fix that.

Expire Podcasts version 2.0

This script checks your podcast subscription list in iTunes 4.9 or greater and decides what files to delete or keep based on a combination of play count and ratings. Any podcast episode with a rating of five stars will be kept regardless of play count, and any episode with a rating of one star will be deleted regardless of play count; any episode with no rating or a rating of 2-4 stars will be deleted if its play count is greater than one.

Play count should be automatically incremented any time you reach the end of a track in iTunes or on your iPod. Rating can be set in several places in iTunes, or on any iPod with a screen (i.e., not the iPod shuffle) by pushing the center select button twice and then using the wheel to choose a number of stars.

When using this script, be sure that iTunes is set to “Keep all episodes” in the podcast preferences. This is a complete replacement for the built-in management in iTunes 4.9.

To install: drop the script into ~/Library/iTunes/Scripts (creating this folder if it isn’t already there) and restart iTunes.

Download (4.85KB)

Expire Podcasts version 1.0

This version works exactly like the one above, but instead of looking in the special Podcasts database introduced in iTunes 4.9, it finds its tracks in a user-defined playlist called “Podcasts”. I used it with NetNewsWire, which has the ability to automatically download podcasts and sync them to an iTunes playlist. It still works with iTunes 4.9, but only if your podcasts are in a user-defined playlist, and only if those podcasts are not downloaded by iTunes itself (see the Technical Notes for more on this). Anything synced from an external application or added by hand and residing in a user playlist called “Podcasts” should be recognized by this script. Personally, I highly recommend using iTunes 4.9’s built-in podcast support, but if you’re stuck with a previous version, this is the way to go.

Download (4.17KB)

Technical Notes

I learned a few interesting things while upgrading this script to support iTunes 4.9. For example, in the original version, deleting a track meant removing it from library playlist 1 (which also removed it from any other playlists of which it was a member) and then telling the Finder to delete the physical file. That didn’t work in the new version, because podcasts aren’t members of library playlist 1. Previously, this playlist was the master list of all tracks managed by iTunes, but now podcasts appear to have their own separate database.

I think the reason for this is that the database structure for podcasts is necessarily more complex, because Apple added some really cool features to iTunes podcast subscriptions. Most of these changes are obvious from the layout of the podcast source window, such as: