#!/usr/bin/python # Copyright (c) 2014 Rik Veenboer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from pyItunes import * from gmusicapi import Mobileclient # iTunes songs l = Library("") songs = [(song.artist, song.name) for id,song in l.songs.items()] # Google Music songs api = Mobileclient() api.login('', '') library = api.get_all_songs() # Find songs to delete delete = filter(lambda song: (song['artist'], song['title']) not in songs, library) delete = [song['id'] for song in delete] # Delete songs api.delete_songs(delete)