Reputation: 33392
Is it possible to add songs to iTunes on OS X programmatically? I.e. say I have a directory of songs I'd like to add to iTunes from a Python script. What is the easiest way to achieve that?
Upvotes: 3
Views: 2093
Reputation:
iTunes has a special folder where it looks for music files to add it automatically to its library:
/Users/<your_username>/Music/iTunes/iTunes Media/Automatically Add to iTunes
(move to this folder by
cd /Users/<your_username>/Music/iTunes/iTunes\ Media/Automatically\ Add\ to\ iTunes
)
All you have to do is to write a python or shell script that copies your music into this folder. e.g., for python
import commands
commands.getoutput("cp file.mp3 /Users/<your_username>/Music/iTunes/iTunes Media/Automatically Add to iTunes")
Upvotes: 3