add code and requirements files
This commit is contained in:
18
delete.py
Normal file
18
delete.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
from pyItunes import *
|
||||||
|
from gmusicapi import Mobileclient
|
||||||
|
|
||||||
|
# iTunes songs
|
||||||
|
l = Library("<full path to iTunes Music Library.xml>")
|
||||||
|
songs = [(song.artist, song.name) for id,song in l.songs.items()]
|
||||||
|
|
||||||
|
# Google Music songs
|
||||||
|
api = Mobileclient()
|
||||||
|
api.login('<account>', '<password>')
|
||||||
|
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)
|
||||||
2
requirements.txt
Normal file
2
requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
git+git://github.com/liamks/pyitunes.git
|
||||||
|
git+git://github.com/simon-weber/Unofficial-Google-Music-API
|
||||||
Reference in New Issue
Block a user