You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from PyLyrics import *
albums = PyLyrics.getAlbums(singer='Eminem')
myalbum = albums[4] #Select your album based on Index
tracks = myalbum.tracks() #or PyLyrics.getTracks(myalbum)
for track in tracks:
print (track) #Each track is a track object
print (track.getLyrics()) #Get the lyrics
Then :
soup = BeautifulSoup(requests.get(url).text)
Traceback (most recent call last):
File "crawler.py", line 31, in <module>
tracks = myalbum.tracks() #or PyLyrics.getTracks(myalbum)
File "/home/isma/.local/lib/python3.7/site-packages/PyLyrics/functions.py", line 38, in tracks
return PyLyrics.getTracks(self)
File "/home/isma/.local/lib/python3.7/site-packages/PyLyrics/functions.py", line 69, in getTracks
songs =[Track(song.text,album,album.artist()) for song in currentAlbum.findNext('songs').findAll('item')]
UnboundLocalError: local variable 'currentAlbum' referenced before assignment
➜ LyricsGenerator
The text was updated successfully, but these errors were encountered:
When :
Then :
The text was updated successfully, but these errors were encountered: