maxkirchoff / google-music-dupe-killer Goto Github PK
View Code? Open in Web Editor NEWRemoves any duplicate songs from Google Music that have the same title and album.
Removes any duplicate songs from Google Music that have the same title and album.
I haven't seen anyone else make this comment so I will. I've used this script and another like it with the latest version of googlemusicapi and both yield this result:
...
logged_in = api.login('[email protected]', 'my_password')
TypeError: login() takes exactly 4 arguments (3 given)
Of course the name and password shown here are not mine. Is it possible the API has changed? Or perhaps I've installed the wrong one?
Thanks for the library.
I ended up having to change line 84 from using input()
to raw_input()
to get rid of the following error:
Traceback (most recent call last):
File "kill_dupes.py", line 113, in <module>
if query_yes_no("Found " + str(len(duplicate_track_ids)) + " duplicate tracks. Delete duplicates?", "no"):
File "kill_dupes.py", line 84, in query_yes_no
choice = input().lower()
File "<string>", line 1, in <module>
NameError: name 'yes' is not defined
input()
tries to evaluate the input; raw_input()
simply takes the string, which seems to be what is needed here.
It fails to log in to my Google account, presumably due to 2-factor login being enabled.
You should add:
else:
print "Failed to log in."
to the end of the script to inform users of this.
Hi, I'm unable to delete my duplicates. It shows me a list of +6000 songs to be deleted, but it fails with this error.
Is this something we can fix client side?
[huge list of uuids skipped]
{"delete": "ddb363d0-c7f6-3677-a2bd-5401efdc3d7c"}, {"delete": "9966ace5-44b6-337f-865b-e5016c16ce05"}, {"delete": "c5b56671-68dc-3aba-869e-001a6c70517a"}, {"delete": "73567e3f-3c1e-3da1-b602-bb66169d1506"}]}', u'method': u'POST', u'params': {u'tier': u'fr', u'alt': u'json', u'hl': u'en_US'}})
(response was: u'{\n "error": {\n "errors": [\n {\n "domain": "global",\n "reason": "internalError",\n "message": "Internal Error"\n }\n ],\n "code": 500,\n "message": "Internal Error"\n }\n}\n')
What should I do if I have 2-step verification? Should I use/generate an app password, or use my regular password to login? Thanks
It would be nice if there was an option to delete the uploaded version of the duplicate and keep the 'official' google play cloud version. It seems that Dupe Killer deletes the google cloud copy but I would rather keep their clean official version than my old mp3 upload version. When you have a duplicate you can see which is which by clicking on the three dots. If there is a "Delete" option then it is your uploaded copy, if there is only "Remove from library" then it is google's copy.
all it says when running is ":2: GmusicapiWarning: login is deprecated and may break unexpectedly; prefer Mobileclient.oauth_login", it then stops running at all
This has annoyed me forever, thank you all for building this...finally cleaned up the library.
Wanted to try to get back on purging my Google Music dups this weekend. I now get an error just running the script. It seems to hit a 404 error...
Traceback (most recent call last):
File "C:\Users\kmk\Desktop\kill_dupes.py", line 54, in
all_tracks = api.get_all_songs()
File "C:\Program Files (UAC Off)\Python27\lib\site-packages\gmusicapi\clients\webclient.py", line 312, in get_all_song
s
to_return = [song for chunk in to_return for song in chunk]
File "C:\Program Files (UAC Off)\Python27\lib\site-packages\gmusicapi\clients\webclient.py", line 324, in _get_all_son
gs
lib_chunk['continuationToken'])
File "C:\Program Files (UAC Off)\Python27\lib\site-packages\gmusicapi\clients\shared.py", line 80, in _make_call
return protocol.perform(self.session, self.validate, _args, *_kwargs)
File "C:\Program Files (UAC Off)\Python27\lib\site-packages\gmusicapi\protocol\shared.py", line 225, in perform
raise CallFailure(err_msg, call_name)
gmusicapi.exceptions.CallFailure: GetLibrarySongs: 404 Client Error: Not Found
The text of the 404 indicates...
"The requested URL /music/services/loadalltracks was not found on this server."
When I get to this part of the process: "Found xx duplicate tracks. Delete duplicates? [y/N]"
Entering "y" and pressing enter gives me this error:
"Traceback (most recent call last):
File "C:\Python27\kill_dupes.py", line 122, in
if query_yes_no("Found " + str(len(duplicate_track_ids)) + " duplicate tracks. Delete duplicates?"):
File "C:\Python27\kill_dupes.py", line 94, in query_yes_no
choice = input().lower()
File "", line 1, in
NameError: name 'y' is not defined"
Can someone advise/help?
Thanks
Sometimes albums have the same song name on them twice!
For example, I have the 50th Anniversary edition Kind of Blue by Miles Davis. It has the song "So What" twice but in different places. It should check Disknumber.TrackNumber too.
Hey there! Tried the latest version, getting this:
Successfully logged in. Beginning duplicate detection process.
Traceback (most recent call last):
File "./kill_dupes", line 115, in
duplicate_tracks = get_duplicate_tracks(all_tracks_by_album, album_track_duplicate_map)
File "./kill_dupes", line 58, in get_duplicate_tracks
discNumberNorm = track['discNumber']
KeyError: 'discNumber'
any ideas?
cheers!
Hello,
I'm a bit of a newbie. I've created a credentials.py but the kill_dupes.py script seems to fail silently. Is there a way of making it's failure more verbose?
Update: I placed the text in the username field that was surrounded by '' marks with "". At this point the script ran correctly.
Is it worth noting to the 2FA users that after you've created the credentials.py and run your script the first time it'll create credentials.pyc and from then on we can delete credentials.py and keep credentials.pyc?
Hi Max,
I was wondering if you can help me out with this script - if it still works that is.
I am running Windows, and I already installed python and already installed gmusicapi and already opened up and edited mobileclient.py and musicmanager.py and included my email and password - I imported from gmusicapi import Mobileclient - and then ran the program through CMD in windows, and it doesn't send any errors, but it does nothing, just gets a new command line as if nothing happened. BTW - I also installed and pointed to the directory for the recent stats binaries to avconv.exe - I think I have done everything yet nothing seems to work.
Can you help me out figuring what I'm doing wrong?
Thanks!
JC
I dont know whats wrong here, admittedly im not a python guy and minimal terminal user. I know how to install tools and use homebrew. I had to update and reconfig some things but then it all seemed to move along...sorta. I got the last couple errors taken care of but when paste in the calls I dont get any response. Am I missing something? I copied the terminal stuff if you can help me find what I did wrong:
https://satori-design.d.pr/QOqoQk
Hi,
The script dont works, I have this error
Traceback (most recent call last):
File "kill-dupes.py", line 96, in <module>
duplicate_tracks = get_duplicate_tracks(all_tracks_by_album, album_track_duplicate_map)
File "kill-dupes.py", line 41, in get_duplicate_tracks
print "Queueing for removal: '" + track['title'] + "' from album '" + track['album'] + "' by '" + track['artist']
File "C:\Python27\lib\encodings\cp850.py", line 12, in encode
return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u2019' in position 24: character maps to <undefined>
This is due to the known issue simon-weber/gmusicapi#408 and happens on at least one of my Windows 10 machines.
From my limited debugging, the root cause seems to be further upstream in win32wnet.netbios. It might be related to having virtual ethernet interfaces.
Anyway, I have a workaround coming.
I know this script only delete duped songs, but would be very useful to delete "Thumb down" songs, maybe with a flag like --delete-disliked or something like that.
thanks, I very appreciated this script.
I ran dupe killer and it caught about a third of the duplicates in my account. However, there are hundreds of tracks that I uploaded that have an exact duplicate match of song name/artist/album but they are not removed because there is a 1 second difference in the song length. These were songs I imported from iTunes and so were probably trimmed slightly differently. But Dupe Killer should have an allowance for duplicates that are within 1 or 2 seconds of each other to account for this slight variance when importing songs.
Hi - trying to run - logged in successfully, but got the following on Windows 10:
C:\Python33\google-music-dupe-killer-master>kill_dupes.py
Successfully logged in. Beginning duplicate detection process.
Traceback (most recent call last):
File "C:\Python33\google-music-dupe-killer-master\kill_dupes.py", line 107, in
album_track_duplicate_map = map_track_duplication(all_tracks)
File "C:\Python33\google-music-dupe-killer-master\kill_dupes.py", line 12, in map_track_duplication
trackNumberNorm = track['trackNumber']
KeyError: 'trackNumber'
C:\Python33\google-music-dupe-killer-master>
Any ideas?
Thanks,
Jon
Sometimes you have a song which is uploaded as a wore quality or the same quality but was recently added and therefore has lower playcount/no thumbs up. It would be great to configure it to first try to preserve the one with higher quality and then the one with more interactions.
Artist doesn't seem to be needed for duplicate detection, but the print statement on line 84 throws an error if one of the duplicate tracks lacks artist information, causing the script to fail.
from gmusicapi import Webclient
ImportError: No module named gmusicapi
Getting that when I try to run the script. I've installed gmusicapi through pip as described in the readme. Is there some step the readme is missing?
The script bombs out every time it hits non-ansi unicode characters in my track titles.
Traceback (most recent call last):
File "C:\Users\kmk\Desktop\kill_dupes.py", line 56, in <module>
duplicate_tracks = get_duplicate_tracks(all_tracks_by_album, album_track_duplicate_map)
File "C:\Users\kmk\Desktop\kill_dupes.py", line 35, in get_duplicate_tracks
print "Queueing for removal: " + track['titleNorm'] + " from album " + track['albumNorm'] + " by " + track['artist']
File "C:\Program Files (UAC Off)\Python27\lib\encodings\cp437.py", line 12, in encode
return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode characters in position 22-25: character maps to <undefined>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.