NISH1001 / lyrics-finder

A simple CLI tool for searching lyrics from http://azlyrics.com/
21 stars 0 forks source link

IndexError #1

Closed jarun closed 6 years ago

jarun commented 6 years ago

Nice utility! I'd been looking for something like this.

I am seeing the following error:

$ ./lyrics.py hello
Searching...
Have patience and be an awesome potato...
Traceback (most recent call last):
  File "./lyrics.py", line 78, in <module>
    main()
  File "./lyrics.py", line 74, in main
    lyrics = lyrics_full(links[0])
  File "./lyrics.py", line 59, in lyrics_full
    lyrics = [x.getText() for x in lyrics][0]
IndexError: list index out of range

Aother improvement suggestion:

The code shows the first result, it would be great to list all query results and let users choose the one they want.

NISH1001 commented 6 years ago

@jarun can you send a PR to this? Yes, for now, it only gives the first result. I will definitely add the listing one soon. Any Pull Requests are welcome.

jarun commented 6 years ago

I guessed there were no results but there are results. Please find the html response here: https://paste.ubuntu.com/p/v9P3ZHpnVP/

I think the parser has issues and you would have to fix it after inspection.

NISH1001 commented 6 years ago

Yes, just checked into this. Seems like azlyrics.com does return another result at the top "Album Results". I will fix this soon. Currently, I have only done the parsing assuming the div for "Song results".

jarun commented 6 years ago

BTW, if you need a Makefile to install it, feel free to pick a Makefile from any of my python projects and modify it. pdd would be a good option.

NISH1001 commented 6 years ago

Sure thanks. I have fixed the parsing issue (naively though). I will close this thread for now. I will be working on that song selector soon (but feel free to send a PR, I guess)