Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Google-Music-Playlist Sync

shane tully

This is a simple Python script that uses the Unofficial-Google-Music-API to sync local XSPF or M3U format playlists to Google Music. For M3U playlists, the song info is determined by the song metadata so only MP3, FLAC, M4A, and MP4 formats are supported.


This script makes use of the Unofficial-Google-Music-API to interface with Google Music. To use it, you'll need to get to gmusicapi module from Either install it with pip or clone it and run python build followed by sudo python install.

Note: that the gmusicapi changes often breaking this script. If this happens feel free to open an issue or submit a pull request fixing compatibility.


Once the GoogleMusicAPI is installed, just run the playlist sync script like any other Python script. It will guide you through logging in and syncing songs.

usage: [-h] [-u [USER]] [-r [ROOT_DIR]] [-n]
                                     [-d] [-y]
                                     playlists [playlists ...]

positional arguments:
  playlists             The filenames of playlists.

optional arguments:
  -h, --help            show this help message and exit
  -u [USER], --user [USER]
                        The Google username/email to log in with.
  -r [ROOT_DIR], --root-dir [ROOT_DIR]
                        The root directory of a music directory. Useful for
                        M3U playlists.
  -n, --no-remove       Only add to playlists; don't remove anything.
  -d, --dry-run         Only show what would be sync'd; don't actually sync
  -y, --yes             Say yes to all prompts.

Credentials File

Users of two factor authentication can store an application specific password in a file so it does not need to be entered each time the script is run. To do this, place a file called creds.json in the same directory as the script with the following contents:

  "username": "your username",
  "password": "your application specific password"

WARNING: Do not store your regular password here as plain text!

Combining the credentials file with the --yes option allows for unattended synchronizations


Copyright (C) 2013 Shane Tully

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see


A quick and dirty Python script to sync local XSPF and M3U playlists to Google Music



LGPL-3.0, GPL-3.0 licenses found

Licenses found






No releases published


No packages published