UnboundLocalError: local variable 'lrc' referenced before assignment
qwertyadrian opened this issue · 3 comments
qwertyadrian commented
I get the following error
Traceback (most recent call last):
File "/home/qwertyadrian/PycharmProjects/pyscripts/lyrics_test.py", line 4, in <module>
lrc = provider.get_lrc('Bâtard - Stromae')
File "/home/qwertyadrian/PycharmProjects/pyscripts/venv/lib/python3.10/site-packages/syncedlyrics/providers/deezer.py", line 46, in get_lrc
return self.get_lrc_by_id(song["id"])
File "/home/qwertyadrian/PycharmProjects/pyscripts/venv/lib/python3.10/site-packages/syncedlyrics/providers/deezer.py", line 38, in get_lrc_by_id
lrc += f"{chunk['lrc_timestamp']} {chunk['line']}\n"
UnboundLocalError: local variable 'lrc' referenced before assignment
when running this code (for example):
from syncedlyrics.providers import Deezer
provider = Deezer()
lrc = provider.get_lrc('Bâtard - Stromae')
In the class method syncedlyrics.providers.Deezer.get_lrc_by_id variable lrc
is not defined.
moehmeni commented
Thanks for the issue, it should be solved now.
moehmeni commented
Not related to this issue but now it seems Deezer API no longer works, I added another provider which is rich and contains this song too. New in v0.3.0
qwertyadrian commented
Thanks for the update.