Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iTunes 11 scripting on Windows

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).

like image 247
Mr Fooz Avatar asked Dec 03 '12 04:12

Mr Fooz


People also ask

Is iTunes Windows 11 compatible?

iTunes is available for Windows 11. Be sure to check the Microsoft Store and iTunes download website if you can't find it in a certain location.

How do I fix iTunes on Windows 11?

You can also try to repair iTunes to fix the iTunes not working on Windows 11/10 issue. Follow the guide below: Open Control Panel > Program and Features > Select iTunes. Right-click it to choose Repair.

How do I update iTunes on Windows 11?

Check for iTunes updates from the Microsoft Store If you install iTunes from the Microsoft Store, new versions will be automatically downloaded; however, you can manually check for updates in the Store. Open the Downloads and Updates pane of the Microsoft Store app.


1 Answers

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).

like image 193
Mr Fooz Avatar answered Sep 28 '22 17:09

Mr Fooz