Spotify has a playlist API but unfortunately it's broken and doesn't support pagination. This is a workaround for exporting all playlists.
- Create an empty RTF file in TextEdit.
- Enter the name of each playlist on its own line.
- Copy and paste the tracks for each playlist from the Spotify desktop app into the RTF file under the correct playlist title.
- Make sure there is a blank line between each playlist.
- Convert the RTF file to plain text.
- Pipe that text file into standard in for this script
swift main.swift < playlists.txt > playlists.md
- Enjoy your MarkDown playlists and wait for Apple to add a search API to Apple Music.