I have my music from CD in both MP3 and FLAC format. Unfortunately, the Google Music uploader insists on uploading both formats, and so I have duplicate tracks. Is there an app/tool/method to find and remove these duplicate tracks from the cloud?
From a PC running Windows 10 x64 (64-bit):
- Install the latest Python 2.7.x version. (I used Python 2.7.10; Do not use any Python 3.x.y version -- I couldn't get it to work with this script.)
- If using Windows, install the Microsoft Visual C++ Compiler for Python 2.7. One of the dependencies of
Install the Google Music API for Python. You should use "pip" (Python's built-in installer script) to install it. On Windows, pip is not added to the PATH environment variable. The quick, lazy workaround is to invoke it specifically:
C:\Python27\Scripts\pip.exe install gmusicapi
See footnote if you're having issues.
ffmpegare probably not required for our purposes.
On the right side of the Google Music Dupe Killer page:
- Click "download ZIP" → Extract the ZIP → Rename kill-dupes to kill-dupes.py → Right click → edit with Notepad (or Notepad++, or anything similar) → Ctrl-F ("find") for "username".
On line #89, you'll see this (line numbers added for ease of reading):
88. api = Mobileclient() 89. logged_in = api.login('username', 'password') 90. 91. if logged_in:
Replace the word username with your Google username, and the word password with your Google password. Leave the single-quotes ' as-is. Save the file with the edits you made.
Allow less secure apps to access your account via Google. If you don't do this, Google will email you telling that they blocked someone accessing your account the first time you run the script. In that email, there is a link to change the setting.
(Note: you may wish to change it back after you are done with this script.)
Put the modified
kill_dupes.pyscript somewhere you can find it. I put it in
Open the Windows command prompt. (Win+R opens the Run dialog, cmd is the command prompt. Press Enter.)
You'll see a Window with this written:
Run Python with the script you made:
Press Enter to run the script:
Successfully logged in. Beginning duplicate detection process.
The program prints a list of the duplicate tracks it found. Type
yand press Enter to remove them, or
nto not remove them.
kill_dupes.pyand maybe its parent program
gmusicapicrash on Unicode characters like
つんく♂. Here is the bug report. Oddly enough, by running the script from IDLE, it worked fine. IDLE should be included with all Python installs.
IDLE (Python GUI)→
IDLE (Python GUI)→
If you just see a blank window, you probably forgot to allow less secure apps to access your account. See step 7.
Footnote: Installing LibAV
- This probably isn't required, but it's what I did the first time I did this. I have since successfully removed duplicates without LibAV, but I did have
ffmpegin my PATH already. The reason I say this step isn't required is because the Google Music API website says:
If you’re going to be uploading music, you’ll likely want Libav’s avconv installed and in your system path, along with at least libmp3lame.
Update 2016-01-09: The site now says:
The only time avconv or ffmpeg is not required is when uploading mp3s without scan-and-match enabled.
Use your judgment as to whether or not installing LibAV is needed.
- Download the newest (sort by date modified) "nightly-lgpl" x86_64 variant of LibAV. It's linked from the site given in step 2.
- I downloaded
libav-x86_64-w64-mingw32-20150524.7z→ extracted the
.7zfile → added the
/usr/bin folderwithin the extracted
libavfolder to the PATH. (The steps are explained in the link in step 2. lat ays to add (Python's built-in installer script)
avconv.exeto the PATH. So my computer now has
D:\Downloads\libav-x86_64-w64-mingw32-20150524\usr\binadded to its PATH.
Other than storing them in seperate locations and specifying where the files you want are or manually going into google music on your pc or phone and deleting them, no. But even if you delete them once the music manager catchs them missing and you havnt changed the folder it will reupload them at least it used to.