11

Does anyone know of a way to programmatically inspect podcasts and create playlists via Python for iTunes 11 on Windows?

Prior to iTunes 11, one could script it on Windows from Python using the win32com.client package. While technically this is still possible, significant portions of the API have been removed with iTunes 11. Apple has also removed the iTunes COM SDK documentation from its website, and the win32com.client interface has always relied on lazy method lookup (so it's not possible to inspect the wrapped COM object for a list of methods or their expected arguments).

Mr Fooz
  • 109,094
  • 6
  • 73
  • 101

1 Answers1

2

The best solution I've found is to use example scripts found on the web to guess at the API and use iPython to verify assumptions. It appears as though Boolean attributes like Podcast become non-existent when false.

For iTunes 10, one can write

is_podcast = track.Podcast

but in iTunes 11, one needs to write

is_podcast = getattr(track, 'Podcast', False)

To be able to resync any created playlists, one can restore the old sidebar, go to the device, go to the podcasts tab, and check off the playlists to sync (as with iTunes 10).

Mr Fooz
  • 109,094
  • 6
  • 73
  • 101