[grilo-plugins/branch-0.2.x] metrolyrics: fix parser after metrolyrics changes



commit 90dead017ded3c82b53d694b1014bf38214e11c8
Author: Victor Toso <me victortoso com>
Date:   Mon Dec 7 07:49:39 2015 +0100

    metrolyrics: fix parser after metrolyrics changes
    
    Metrolyrics now include `class="js-lyric-text"` in the div for lyrics
    and this patch just ignore it.
    
    Also remove `<br>` noise that was introduced recently.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759109

 src/lua-factory/sources/grl-metrolyrics.lua |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/lua-factory/sources/grl-metrolyrics.lua b/src/lua-factory/sources/grl-metrolyrics.lua
index cb42f5d..ce2d63c 100644
--- a/src/lua-factory/sources/grl-metrolyrics.lua
+++ b/src/lua-factory/sources/grl-metrolyrics.lua
@@ -86,12 +86,13 @@ end
 
 function metrolyrics_get_lyrics(feed)
   local media = {}
-  local lyrics_body = '<div id="lyrics%-body%-text">(.-)</div>'
+  local lyrics_body = '<div id="lyrics%-body%-text".->(.-)</div>'
   local noise_array = {
     { noise = "</p>",  sub = "\n\n" },
     { noise = "<p class='verse'><p class='verse'>",  sub = "\n\n" },
     { noise = "<p class='verse'>",  sub = "" },
     { noise = "<br/>",  sub = "" },
+    { noise = "<br>",  sub = "" },
   }
 
   -- remove html noise


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]