I’ve switched from Spotify to Google Play Music (also known as “Google All-Inclusive” or “Google All Access”) a while ago. Although I can’t imagine Google losing any data, I want to make sure I don’t lose any of my playlists by accident. Google doesn’t offer a backup feature (yet?), so I needed another solution. Luckily there is an unofficial Python API, so writing a backup script was fairly easy. It saves the content (id, title, artist, album) of all user-created playlists as XML.
import time import xml.etree.ElementTree as ET from gmusicapi import Mobileclient
""" Saves all user-created Google Play Music playlists as an XML file. """