Convert iTunes podcast tracks to regular music files

May 21, '08 07:30:02AM

Contributed by: broasted

Although there are a few hints that relate to this, I think I've streamlined the process for taking a podcast episode (such as from the excellent KEXP Song of the Day podcast) and automatically stripping the podcast ID3 tag, deleting the podcast episode, and re-adding the track to your iTunes Music Library as a regular MP3 file.

First, you must download fixid3tag. Then in Terminal, type gcc fixid3tag.c -o fixid3tag (you must have the Developer Tools installed). Put the fixid3tag binary someplace; I put mine in ~/Documents.

Next, take the belwo AppleScript and put it in ~/Library » iTunes » Scripts. The first couple of lines are used to specify two important file locations -- the location of the fixid3tag binary, and the location of your temporary folder (I used ~/Desktop/Fixed.)

tell application "Finder"
  --This is where you put the path to the compiled fixid3tag
  set FixerLocation to "~/Documents/fixid3tag"
  --This is the path to your temporary folder
  set FixedFolder to (folder "Fixed" in desktop) as alias
end tell

tell application "iTunes"
  set trackList to the selection of window 1 
  repeat with theTrack in trackList
    set theTrackName to ((the location of theTrack))
    do shell script FixerLocation & " " & quoted form of POSIX path of theTrackName
    do shell script "cp " & quoted form of POSIX path of theTrackName & " " & quoted form of POSIX path of FixedFolder
    delete theTrack
    do shell script "rm " & quoted form of POSIX path of theTrackName
  end repeat
end tell

--add fixed files to iTunes
tell application "Finder"
  set theseFiles to (files of folder FixedFolder as alias list)
end tell
try
  tell application "iTunes" to add theseFiles
on error err
end try

--delete converted temp files
tell application "Finder"
  delete every item of folder FixedFolder
end tell
Now, just select one or several podcast episodes, and they will disappear from the Podcast listing, and reappear in your iTunes library.

[robg adds: I haven't tested this one.]

Comments (18)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20080518143935527