elmoiv / azapi

Get Lyrics from AZLyrics.com like a Boss ~(0_0)~
GNU General Public License v3.0
122 stars 12 forks source link

[Solved] .getSongs() TypeError: 'NoneType' object is not iterable #3

Closed deepbluesea closed 5 years ago

deepbluesea commented 5 years ago

Describe the bug

----> 1 songs = api.getSongs()

1 frames
/usr/local/lib/python3.6/dist-packages/azapi/AZtools.py in filtr(inpt, isFile)
     14     if isFile:
     15         return ''.join(i for i in inpt if i not in r'<>:"/\|?*')
---> 16     return ''.join(i.lower() for i in inpt if i.lower() in letters)
     17 
     18 def ParseLyric(page):

TypeError: 'NoneType' object is not iterable

To Reproduce Steps to reproduce the behavior: `from azapi import AZlyrics

api = AZlyrics('Taylor Swift')

songs = api.getSongs() `

Expected behavior self explanatory

deepbluesea commented 5 years ago

fixed with api = AZlyrics() api.getSongs('Taylor Swift')

elmoiv commented 5 years ago

When initializing AZlyrics class, you must pass both artist and title arguments. but for getSongs(), artist should be passed to this function if not given to the initializer.

elmoiv commented 5 years ago

I updated azapi.py to avoid passing a NoneType object. If your problem is solved, kindly close this issue :)