Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions plugins/lyrics.pm
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,25 @@ my %Sites= # id => [name,url,?post?,function] if the function return 1 => lyrics
return 0 if $_[0]=~m!&#91;&#46;&#46;&#46;&#93;(?:<br ?/>)*<i>!; # truncated lyrics : "[...]" followed by italic explanation => not auto-saved
return !!$1;
}],
musixmatch => [musixmatch => 'https://www.musixmatch.com/lyrics/%a/%t', undef,
musixmatch => [musixmatch =>
sub {
if ($_[0] =~ /<span id="lyrics-html"/) {
$_[0] =~ s/.*<span id="lyrics-html".+?>(.+?)<\/span>.*/$1/s;
$_[0] =~ s/[\r\n]/<br>/g;
} else {
$_[0] = $notfound;
}
}],
::ReplaceFields($_[0], 'https://www.musixmatch.com/lyrics/%a/%t', sub {
$_[0] =~ s/ (&|\*|\-) / /gr
=~ s/(\'|\,|\.) / /gr
=~ s/\(.*?\)//gr # remove comments in parenthesis: a.e. (Extended Version), (Chillout Mix), etc
=~ s/^\s+|\s+$//gr
=~ s/\s/-/gr
});
},
undef,
sub {
my $text;
if($_[0] =~ /"body":"(.*?)","/){
$text = $1 =~ s|\\n|<br>|gr =~ s|\\(["'])|$1|gr;
}
$_[0] = $text || $notfound;
return !!$text;
}],
#lyricwikiapi => [lyricwiki => 'http://lyricwiki.org/api.php?artist=%a&song=%t&fmt=html',undef,
# sub { $_[0]!~m#<pre>\W*Not found\W*</pre>#s }],
#azlyrics => [ azlyrics => 'http://search.azlyrics.com/cgi-bin/azseek.cgi?q="%a"+"%t"'],
Expand Down