kalbhor / MusicRepair

Fixes music metadata and adds album art.
MIT License
596 stars 43 forks source link

Crash on file #19

Closed JiLiZART closed 7 years ago

JiLiZART commented 7 years ago

macOS 10.12.1

Error Trace

6c64f324fe3b2f.mp3
> Adding metadata
    * Finding metadata from Spotify.
    * Could not find metadata from spotify, trying something else.
    * Couldn't find song details
    * Trying to extract album art from Google.com
    * Trying to extract album art from Bing.com
Traceback (most recent call last):
  File "/usr/local/bin/musicrepair", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/musicrepair/command_line.py", line 396, in main
    fix_music(arg_rename_format, norename=arg_norename)
  File "/usr/local/lib/python2.7/site-packages/musicrepair/command_line.py", line 312, in fix_music
    albumart = albumsearch.img_search_bing(album)
  File "/usr/local/lib/python2.7/site-packages/musicrepair/albumsearch.py", line 39, in img_search_bing
    return links_dict["0"]
KeyError: '0'
kalbhor commented 7 years ago

I believe that the problem occurs because my Microsoft cognitive services API key only provided 1000 hits per day. I will add an exception statement to handle this error, but that would mean that this current file of yours will not be repaired. Since no metadata was found from Spotify and failed to find album art from Google.

JiLiZART commented 7 years ago

Can it just skip this file if any error occurs or if not any data found?

kalbhor commented 7 years ago

@JiLiZART I have added the exception statement, it should skip the file now. Upgrade musicrepair and let me know if it works.

JiLiZART commented 7 years ago

It works! 👍