Liquid error: undefined method `source' for nil:NilClass Liquid error: undefined method `url' for nil:NilClass

Is this your first visit? You may want to subscribe to the feed.

Articles tagged with podcast

Bending iTunes to my will with RubyOSA: take 1

A couple months ago I expressed my frustration about iTunes not letting me move podcast files into my library. Several people commented with suggestions, such as converting the ID3 tag to an older version, re-importing the track, and then converting the ID3 tag back to 2.4. This is definitely better than the solution I had found, but still a pain.

I tried to find a scriptable solution, but iTunes doesn’t expose, though AppleScript, the ability to change the ID3 tag version or the mystical ID3 tag attribute that tells iTunes that it’s a podcast.

So, I’ve turned to Ruby. Though a little introspection and experimentation with ID3lib-ruby, I’ve figured out that it is the CTO (Content Type) ID3v2 tag set to “Podcast” that iTunes is using to put the files in the Podcasts folder. Clearing the CTO tag and readding the track in iTunes will move it into the Library.

So, with RubyOSA, I’ve written a little script that will loop through the selected tracks in iTunes and clear the CTO ID3 tag.

require 'rubygems'
require 'rbosa'
require 'ID3lib'

itunes = OSA.app('itunes')
itunes.selection.get.each do |track|
  if track.is_a?(OSA::Itunes::Track)
    location = URI.decode(URI.parse(track.location.__data__('furl')).path)
    tag = ID3Lib::Tag.new(location)
    tag.content_type = nil
    tag.update!
  end
end

There are a few remaining problems that I would like to tackle:

  1. I can’t figure out how to delete and add the track through RubyOSA. There is a delete method on the track, but doesn’t appear to do anything.
  2. I want the script to display a dialog confirming the actions about to take place.
  3. I want to be able to execute the script from the Scripts menu in iTunes, which appears to involve installing OSA Components.

Overall, this has been a fun experiment (and a reason to play with RubyOSA). I’m looking forward to Leopard when this is all built in!

Code: podcast Jun 30, 2007 โ— updated Jun 30, 2007 โ— 3 comments

Moving Podcast tracks into your iTunes library

A while back, Daniel posted about building an instant indie music collection by subscribing to KEXP’s Song of the day podcast. I did that, and it’s been great. Now I have all this great indie music, but the problem is that it’s locked up in an iTunes podcast. I can’t continually listen to it because iTunes plays podcasts one track at a time.

I’ve been mildly annoyed about this for a few months, but this past weekend I thought I would try to remedy that. I tried importing the mp3 files into the library, and all that did was make each track appear twice in the podcast. So, I tried copying all the files to an external folder, deleting them from the podcast, and then re-importing the files; iTunes re-adds them to the podcast.

After scouring mailing lists and forums, it turns out that the only (known) way to accomplish this is to right click on the files and select “Convert Selection to AAC” (or whatever encoding format you use). This re-encodes the file as AAC and adds it to your library, and now you can delete it from the podcast. This is really annoying. Why do I need to re-encode the files (further decreasing the sound quality)?

You see, iTunes tries to be smart (or it’s too dumb, one of those two). I had a similar problem when I imported an audio book from CD and wanted it to show up under “Audiobooks” in my library. One would think this would be as simple as setting the genre on the tracks, but it turns out, the files have to be encoded in AAC and saved with a .m4b file extension (there’s an applescript available to automate this). All of this makes me think that the whole Library pane in iTunes is a big hack. It only works right when you buy stuff from the iTunes store. Annoying!

Code: podcast Apr 17, 2007 โ— 34 comments

Subscribe

Browse by Tag