diff --git a/app.py b/app.py index c47d771..a1271f5 100644 --- a/app.py +++ b/app.py @@ -54,9 +54,9 @@ def validate_collision(path): def name_format(path, meta): information = { - 'artist': ','.join([artist[0] for artist in meta['artist']]), - 'title': meta['musicName'], - 'album': meta['album'] + 'artist': ','.join([artist[0] for artist in (meta.get('artist') if meta.get('artist') is not None else [])]), + 'title': meta.get('musicName'), + 'album': meta.get('album') } def substitute(matched): diff --git a/requirements.txt b/requirements.txt index 97a6859..db67121 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ +Crypto mutagen pycryptodome