From 3a49625397f93749523c610b289089b7142740ab Mon Sep 17 00:00:00 2001 From: Stefan Maksimovic Date: Thu, 12 Oct 2017 11:28:59 +0200 Subject: [PATCH] Correctly include whole lyrics for Metrolyrics (#12) --- lyricsfinder.lua | 42 +++++++++++++----------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/lyricsfinder.lua b/lyricsfinder.lua index 332b3f8..6c03744 100644 --- a/lyricsfinder.lua +++ b/lyricsfinder.lua @@ -866,40 +866,24 @@ function fetch_lyrics(url) if metro_pos then --MetroLyrics - local a = string.find(data, 'lyrics%-body%-text', 1) + local a = string.find(data, 'lyrics%-body', 1) if a == nil then return "" end - local midsong = string.find(data, 'mid%-song%-discussion') - - if midsong == nil then - -- do nothing - else - --
', a) + local endWidgetRelated = string.find(data, '', a) + local widgetPhotos = string.find(data, '', a) + local endWidgetPhotos = string.find(data, '', a) + + data = data:sub(0, widgetRelated) .. + data:sub(endWidgetRelated, widgetPhotos) .. + data:sub(endWidgetPhotos) + + local lyricsEnd = string.find(data, "writers", a) - 10 + return data:sub(a + 13, lyricsEnd) end if lyricsmania then local strong_text = ""