A small library for programmatically interfacing with local media libraries, including
- The local iTunes and Apple Music/TV/Podcasts library
- iTunes-compatible XML files
- The Mixxx library (WIP)
To export the local Apple media library to an iTunes-compatible XML, use the following snippet:
import MusicLibrary
let importer = try LocalAppleMediaImporter()
let exporter = LibraryXMLExporter(filePath: "path/to/output.xml")
let library = try importer.readLibrary()
try exporter.write(library: library)
The full example can be found here.