mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
[#200 state:fixed] Fixed a KeyError wihle parsing iTunes XML.
This commit is contained in:
parent
a99c40b5d8
commit
3441e51c0e
@ -86,11 +86,11 @@ def get_itunes_songs(plistpath):
|
||||
plist = plistlib.readPlistFromBytes(s.encode('utf-8'))
|
||||
result = []
|
||||
for song_data in plist['Tracks'].values():
|
||||
try:
|
||||
if song_data['Track Type'] != 'File':
|
||||
continue
|
||||
try:
|
||||
song = ITunesSong(song_data)
|
||||
except KeyError: # No "Location" or "Track ID" key in track
|
||||
except KeyError: # No "Track Type", "Location" or "Track ID" key in track
|
||||
continue
|
||||
if io.exists(song.path):
|
||||
result.append(song)
|
||||
|
Loading…
x
Reference in New Issue
Block a user