glomatico / gytmdl

A Python CLI app for downloading YouTube Music songs with tags from YouTube Music.
109 stars 13 forks source link

Crash when song is missing year metadata #1

Closed skmd0 closed 1 year ago

skmd0 commented 1 year ago

It seems like some songs could be missing year metadata and when that happens script crashes. Example song from trace below. This is not a sole example, the same issue occurred for 3 other songs.

Failed to download "Syntax" (track 194/194) from URL 1/1)
Traceback (most recent call last):
  File "C:\Users\redacted\AppData\Roaming\Python\Python310\site-packages\gytmdl\__init__.py", line 111, in main
    tags = dl.get_tags(ytmusic_watch_playlist)
  File "C:\Users\redacted\AppData\Roaming\Python\Python310\site-packages\gytmdl\gytmdl.py", line 85, in get_tags
    '\xa9day': [ytmusic_album['year']],
KeyError: 'year'
glomatico commented 1 year ago

Should be fixed in the new version.