Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnboundLocalError: local variable 'lrc' referenced before assignment #2

Closed
qwertyadrian opened this issue Jan 21, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@qwertyadrian
Copy link

qwertyadrian commented Jan 21, 2023

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 pushed a commit that referenced this issue Jan 21, 2023
@moehmeni moehmeni added the bug Something isn't working label Jan 21, 2023
@moehmeni
Copy link
Owner

Thanks for the issue, it should be solved now.

@moehmeni
Copy link
Owner

moehmeni commented Jan 21, 2023

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
Copy link
Author

Thanks for the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants