Skip to content

Commit

Permalink
Fix GeniusParser
Browse files Browse the repository at this point in the history
  • Loading branch information
dmo60 committed Dec 5, 2016
1 parent 888a5d2 commit 9b13c1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lLyrics/GeniusParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def parse(self):

def get_lyrics(self, resp):
# cut HTML source to relevant part
start = resp.find("<lyrics class=\"lyrics\"")
start = resp.find("<lyrics")
if start == -1:
print("lyrics start not found")
return ""
Expand All @@ -66,6 +66,7 @@ def get_lyrics(self, resp):
# replace unwanted parts
resp = re.sub("<lyrics[^>]*>", "", resp)
resp = re.sub("<a[^>]*>", "", resp)
resp = re.sub("<!--[^>]*>", "", resp)
resp = resp.replace("</a>", "")
resp = resp.replace("<br>", "")
resp = resp.replace("<br />", "")
Expand Down

0 comments on commit 9b13c1b

Please sign in to comment.