goktug97 / yet-another-spotify-lyrics

Command Line Spotify Lyrics with Album Cover
MIT License
83 stars 1 forks source link

Crash when song is changing #9

Open PoSayDone opened 3 years ago

PoSayDone commented 3 years ago

I've changed some code in utils.py and in spotify_lyrics.py because I dont want to get metadata and lyrcis. I need only artwork. Maybe I broke something Here is the changes: utils.py

def fetch_lyrics(artist, title):
    final_lyrics = ('')
    return final_lyrics

spotify_lyrics.py

    def print_metadata(self):
        self.changed = True
        os.system('clear')
        utils.move_cursor(0, 0)
        print()
        print()
        print()
 album_cover = canvas.create_placement(
            'album_cover',
            x=4, y=9,
            width=28,
            height=28,
            )
        album_cover.path = self.image_file
        album_cover.visibility = ueberzug.Visibility.VISIBLE

Error:

Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/usr/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/usr/lib/python3.8/site-packages/ueberzug/lib/v0/__init__.py", line 367, in decorator return function(*args, canvas=self, **kwargs) File "/home/posaydone/.local/lib/python3.8/site-packages/spotify_lyrics.py", line 126, in main song, artist, album, art_url = self.spotify.metadata() File "/home/posaydone/.local/lib/python3.8/site-packages/utils.py", line 73, in metadata title = metadata['xesam:title'].replace("&", "&") KeyError: 'xesam:title'