Skip to content
Open
188 changes: 41 additions & 147 deletions context/lyrics_providers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,42 +23,6 @@
</extract>
<invalidIndicator value="Couldn't find that page."/>
</provider>
<provider name="chartlyrics.com" charset="utf-8" url="http://api.chartlyrics.com/apiv1.asmx/SearchLyricDirect?artist={artist}&amp;song={title}">
<urlFormat replace="_@,;&amp;\/&quot;#" with="_"/>
<extract>
<item tag="&lt;Lyric&gt;"/>
</extract>
<invalidIndicator value="ERROR"/>
</provider>
<provider name="darklyrics.com" charset="utf-8" url="http://www.darklyrics.com/lyrics/{artist2}/{album2}.html">
<extract> <!-- modified -->
<item begin="&lt;h3&gt;&lt;a name=&quot;{track}&quot;&gt;{track}. {Title}&lt;/a&gt;&lt;/h3&gt;&lt;br/&gt;" end="&lt;h3&gt;"/>
</extract>
<extract> <!-- modified -->
<item begin="&lt;h3&gt;&lt;a name=&quot;{track}&quot;&gt;{track}. {Title}&lt;/a&gt;&lt;/h3&gt;&lt;br/&gt;" end="&lt;div class=&quot;thanks&quot;&gt;"/>
</extract>
<extract> <!-- new -->
<item begin="&lt;h3&gt;&lt;a name=&quot;{track}&quot;&gt;{track}. {Title}&lt;/a&gt;&lt;/h3&gt;&lt;br/&gt;" end="&lt;br/&gt;&lt;br/&gt;"/>
</extract>
<invalidIndicator value="The page you requested was not found on DarkLyrics.com."/>
</provider>
<provider name="directlyrics.com" charset="utf-8" url="http://www.directlyrics.com/{artist}-{title}-lyrics.html"> <!-- was iso-8859-1 -->
<urlFormat replace=" _@,;&amp;\/'&quot;" with="-"/>
<urlFormat replace="." with=""/>
<extract>
<item tag="&lt;div id=&quot;lyricsContent&quot;&gt;"/>
<item tag="&lt;p&gt;"/>
</extract>
<extract> <!-- new -->
<item begin="&lt;div class=&quot;lyrics&quot;&gt;" end="&lt;/div&gt;"/>
</extract>
<exclude>
<item begin="&lt;b&gt;" end="&lt;/b&gt;"/>
</exclude>
<exclude> <!-- new -->
<item begin="&lt;script async src=&quot;" end="&lt;/script&gt;&lt;br&gt;"/>
</exclude>
</provider>
<provider name="elyrics.net" charset="iso-8859-1" url="https://www.elyrics.net/read/{a}/{artist}-lyrics/{title}-lyrics.html">
<urlFormat replace=" _@;&amp;\/&quot;" with="-"/>
<urlFormat replace="'" with="_"/>
Expand All @@ -77,27 +41,6 @@
</exclude>
<invalidIndicator value="Page not Found"/>
</provider>
<provider name="hindilyrics.net (Bollywood songs)" charset="utf-8" url="http://www.hindilyrics.net/lyrics/of-{Title}.html">
<urlFormat replace=" _@;\/&quot;'()[]" with="%20"/>
<urlFormat replace="?" with=""/>
<extract>
<item begin="&lt;div class=nm&gt;Movie&lt;/div&gt;:" end="&lt;/pre&gt;"/>
</extract>
<exclude>
<item begin="&lt;span class=" end="&quot;&gt;"/>
</exclude>
<invalidIndicator value="Couldn't find that page."/>
</provider>
<!-- Issue #1571
<provider name="Encyclopaedia Metallum" charset="utf-8" url="https://www.metal-archives.com/search/ajax-advanced/searching/songs/?songTitle={title}&amp;bandName={artist}&amp;ExactBandMatch=1">
<extract>
<item url="http://www.metal-archives.com/release/ajax-view-lyrics/id/{id}"/>
<item begin="id=\&quot;lyricsLink_" end="&quot;"/>
</extract>
<invalidIndicator value="&quot;iTotalRecords&quot;: 0"/>
<invalidIndicator value="lyrics not available"/>
</provider>
-->
<provider name="letras.mus.br" charset="utf-8" url="https://www.letras.mus.br/winamp.php?musica={title}&amp;artista={artist}">
<urlFormat replace="_@,;&amp;\/&quot;" with="_"/>
<urlFormat replace=" " with="+"/>
Expand Down Expand Up @@ -128,10 +71,20 @@
<urlFormat replace="Çç" with="c"/>
<urlFormat replace="ß" with="ss"/>
<urlFormat replace="&amp;" with="and"/>
<!-- Current (React) pages hold the lyrics in one or more
<div data-lyrics-container="true" class="Lyrics__Container-sc-HASH">
elements. The class carries a build-specific hash, so match on the
attribute instead. The old <div class="lyrics"> is kept as a fallback. -->
<extract>
<item container="data-lyrics-container"/>
</extract>
<extract>
<item tag="&lt;div class=&quot;lyrics&quot;&gt;"/>
</extract>
<exclude>
<!-- The containers also hold page furniture - contributor count, song title, summary.
Genius marks all of it as excluded from selection, so drop those elements whole. -->
<item container="data-exclude-from-selection"/>
<item begin="&lt;!--" end="--&gt;"/>
<item begin="&lt;a href=" end="&gt;"/>
<item begin="&lt;/a" end="&gt;"/>
Expand All @@ -144,16 +97,6 @@
</extract>
<invalidIndicator value="ERROR"/>
</provider>
<provider name="loudson.gs" charset="utf-8" url="http://www.loudson.gs/{a}/{artist}/{album}/{title}">
<urlFormat replace=" _@,;&amp;\/&quot;" with="-"/>
<urlFormat replace="." with=""/>
<extract>
<item tag="&lt;div class=&quot;middle_col_TracksLyrics &quot;&gt;"/>
</extract>
<extract> <!-- new -->
<item tag="&lt;div class=&quot;middle_col_TracksLyrics&quot;&gt;"/>
</extract>
</provider>
<provider name="lyrics.com" charset="utf-8" url="https://www.lyrics.com/lyrics/{artist}/{title}.html">
<urlFormat replace=" _@,;&amp;\/&quot;" with="-"/>
<urlFormat replace="'." with=""/>
Expand All @@ -170,29 +113,11 @@
<invalidIndicator value="we do not have the lyric for this song"/>
<invalidIndicator value="Your name will be printed as part of the credit when your lyric is approved"/>
</provider>
<provider name="lyrics.wikia.com" charset="utf-8" url="https://lyrics.wikia.com/api.php">
<!-- These are not used, as mediawiki API is used instead...
<urlFormat replace=" _@;\&quot;" with="_"/>
<urlFormat replace="?" with="%3F"/>
<extract>
<item begin="&lt;div class='lyricbox'&gt;" end="&lt;!- -"/> TODO: This was a comment ( ! - - ) but brakes commentinging out!
</extract>
<exclude>
<item tag="&lt;div class='rtMatcher'&gt;"/>
<item tag="&lt;span style=&quot;padding:1em&quot;&gt;"/>
</exclude>
-->
</provider>
<provider name="lyricsdownload.com" charset="utf-8" url="http://www.lyricsdownload.com/{artist}-{title}-lyrics.html">
<urlFormat replace=" _@,;&amp;\/&quot;" with="-"/>
<urlFormat replace="." with=""/>
<provider name="lyricsmania.com" charset="utf-8" url="https://www.lyricsmania.com/{title}_lyrics_{artist}.html">
<urlFormat replace=" _@;&amp;\/&quot;'." with="_"/>
<extract>
<item tag="&lt;div id=&quot;div_customCSS&quot;&gt;"/>
<item tag="&lt;div class=&quot;lyrics-body&quot;&gt;"/>
</extract>
<invalidIndicator value="We haven't lyrics of this song"/>
</provider>
<provider name="lyricsmania.com" charset="iso-8859-1" url="https://www.lyricsmania.com/{title}_lyrics_{artist}.html">
<urlFormat replace=" _@;&amp;\/&quot;'." with="_"/>
<extract> <!-- new -->
<item tag="&lt;div id='songlyrics_h' class='dn'&gt;"/>
</extract>
Expand All @@ -202,28 +127,29 @@
</extract>
<invalidIndicator value="The lyrics you requested is not in our archive yet,"/>
</provider>
<provider name="lyricsmode.com" charset="iso-8859-1" url="http://www.lyricsmode.com/lyrics/{a}/{artist}/{title}.html">
<provider name="lyricsmode.com" charset="utf-8" url="https://www.lyricsmode.com/lyrics/{a}/{artist}/{title}.html">
<urlFormat replace=" ._@,;&amp;\/&quot;" with="_"/>
<!-- The lyrics moved from <p id="lyrics_text"> to <div id="lyrics_text">. The tag form is
used rather than begin/end as it retries without the closing '>', so the match also
survives any attributes added to the element later on. -->
<extract>
<item tag="&lt;div id='songlyrics_h' class='dn'&gt;"/>
<item tag="&lt;div id=&quot;lyrics_text&quot;&gt;"/>
</extract>
<extract> <!-- new -->
<item begin="&lt;p id=&quot;lyrics_text&quot;&gt;" end="&lt;/p&gt;"/>
<extract>
<item tag="&lt;p id=&quot;lyrics_text&quot;&gt;"/>
</extract>
<invalidIndicator value="Sorry, we have no"/>
</provider>
<provider name="lyricsreg.com" charset="iso-8859-1" url="https://www.lyricsreg.com/lyrics/{artist}/{title}/">
<urlFormat replace=" _@,;&amp;\/&quot;" with="+"/>
<urlFormat replace="'." with=""/>
<extract>
<item begin="Ringtone to your Cell" end="Ringtone to your Cell"/>
<item begin="&lt;div style=&quot;text-align:center;&quot;&gt;" end="&lt;a"/>
<item tag="&lt;div id='songlyrics_h' class='dn'&gt;"/>
</extract>
<extract> <!-- new -->
<item begin="Ringtone to your Cell" end="Ringtone to your Cell"/>
<item begin="&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;" end="&lt;a"/>
<item begin="&lt;p id=&quot;lyrics_text&quot;&gt;" end="&lt;/p&gt;"/>
</extract>
<invalidIndicator value="Page not Found"/>
<exclude>
<!-- The annotation buttons ("Explain", "Request") sit within the lyrics element. They
are the only elements carrying this attribute, so drop them whole. -->
<item container="data-annotation-type"/>
</exclude>
<invalidIndicator value="Sorry, we have no"/>
</provider>
<provider name="lyriki.com" charset="utf-8" url="http://www.lyriki.com/{artist}:{title}">
<urlFormat replace=" _@,;&amp;\/&quot;" with="_"/>
Expand All @@ -233,47 +159,15 @@
<item tag="&lt;p&gt;"/>
</extract>
</provider>
<!-- broken
<provider name="metrolyrics.com" charset="utf-8" url="http://www.metrolyrics.com/{title}-lyrics-{artist}.html">
<urlFormat replace=" _@,;&amp;\/&quot;" with="-"/>
<urlFormat replace="'." with=""/>
<extract>
<item tag="&lt;span id=&quot;lyrics&quot;&gt;"/>
</extract>
<extract>
<item tag="&lt;div id=&quot;lyrics&quot;&gt;"/>
</extract>
<extract>
<item tag="&lt;div id=&quot;lyrics-body-text&quot;&gt;"/>
</extract>
<exclude>
<item tag="&lt;h5&gt;"/>
</exclude>
<invalidIndicator value="These lyrics are missing"/>
</provider>
-->
<provider name="mp3lyrics.org" charset="utf-8" url="http://www.mp3lyrics.org/{a}/{artist}/{title}/">
<urlFormat replace=" _@,;&amp;\/&quot;" with="-"/>
<urlFormat replace="'." with=""/>
<extract>
<item tag="&lt;span id=gn_lyricsB&gt;"/>
</extract>
<extract>
<item tag="&lt;div class=&quot;KonaBody&quot; id=&quot;EchoTopic&quot;&gt;"/>
</extract>
<extract> <!-- new -->
<item tag="&lt;div id=&quot;lyrics_text&quot;&gt;"/>
</extract>
<exclude>
<item tag="&lt;font size=2&gt;"/>
<item begin="&lt;b&gt;&lt;i&gt;" end="&lt;/u&gt;&lt;/b&gt;:"/>
<item begin="&lt;b&gt;Lyrics" end="&lt;/b&gt;"/>
</exclude>
<invalidIndicator value="Something went wrong"/>
</provider>
<provider name="musixmatch.com" charset="utf-8" url="https://www.musixmatch.com/lyrics/{Artist}/{Title}">
<urlFormat replace=" _@;\/&quot;'()[]" with="-"/>
<urlFormat replace="?" with=""/>
<!-- The page renders client-side, so the lyrics are in the __NEXT_DATA__ JSON rather than
in the markup, and still carry their JSON escapes once pulled out. -->
<extract>
<item begin="&quot;lyrics&quot;:{&quot;body&quot;:&quot;" end="&quot;,&quot;canEdit&quot;"/>
<item unescape="json"/>
</extract>
<extract>
<item begin="&lt;span id=&quot;lyrics-html&quot;" end="&lt;/span&gt;"/>
</extract>
Expand All @@ -285,6 +179,13 @@
<provider name="songlyrics.com" charset="utf-8" url="https://www.songlyrics.com/{artist}/{title}-lyrics/">
<urlFormat replace=" ._@,;&amp;\/&quot;" with="-"/>
<urlFormat replace="'" with="_"/>
<!-- The lyrics are in the schema.org JSON-LD block rather than in the markup. Within it a
double quote is always written as an escape, so the first one following the start of
the value is the one closing it, and a quote followed by a brace ends the object. -->
<extract>
<item begin="&quot;lyrics&quot;:{&quot;@type&quot;:&quot;CreativeWork&quot;,&quot;text&quot;:&quot;" end="&quot;}"/>
<item unescape="json"/>
</extract>
<extract>
<item tag="&lt;p id=&quot;songLyricsDiv&quot; ondragstart=&quot;return false;&quot; onselectstart=&quot;return false;&quot; oncontextmenu=&quot;return false;&quot; class=&quot;songLyricsV14&quot; style=&quot;font-size: 14px;z-index: 9999;position: absolute;left: -6000px;&quot;&gt;"/>
</extract>
Expand Down Expand Up @@ -318,13 +219,6 @@
<item begin="&quot;id-" end="&quot;&gt;"/>
</exclude>
</provider>
<provider name="teksty.org" title="{artist} - {title} - tekst" charset="utf-8" url="http://teksty.org/{artist},{title},tekst-piosenki">
<urlFormat replace=" _@,;&amp;\/&quot;'" with="-"/>
<urlFormat replace="." with=""/>
<extract>
<item begin="&lt;div class=&quot;songText&quot; id=&quot;songContent&quot;&gt;" end="&lt;/div&gt;"/>
</extract>
</provider>
<provider name="vagalume.com.br" charset="iso-8859-1" url="http://vagalume.com.br/{artist}/{title}.html">
<urlFormat replace=" _@,;&amp;\/'&quot;." with="-"/>
<extract>
Expand Down
16 changes: 14 additions & 2 deletions context/ultimatelyrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,22 @@ static UltimateLyricsProvider::Rule parseRule(QXmlStreamReader* reader)
if (QLatin1String("item") == reader->name()) {
QXmlStreamAttributes attr = reader->attributes();
if (attr.hasAttribute("tag")) {
ret << UltimateLyricsProvider::RuleItem(attr.value("tag").toString(), QString());
ret << UltimateLyricsProvider::RuleItem(UltimateLyricsProvider::RuleItem::XmlTag, attr.value("tag").toString());
}
else if (attr.hasAttribute("begin")) {
ret << UltimateLyricsProvider::RuleItem(attr.value("begin").toString(), attr.value("end").toString());
// An item with no 'end' used to be indistinguishable from a 'tag' item, and was
// handled as one - keep that behaviour for hand-written provider files.
ret << (attr.hasAttribute("end")
? UltimateLyricsProvider::RuleItem(UltimateLyricsProvider::RuleItem::Range,
attr.value("begin").toString(), attr.value("end").toString())
: UltimateLyricsProvider::RuleItem(UltimateLyricsProvider::RuleItem::XmlTag,
attr.value("begin").toString()));
}
else if (attr.hasAttribute("container")) {
ret << UltimateLyricsProvider::RuleItem(UltimateLyricsProvider::RuleItem::Container, attr.value("container").toString());
}
else if (attr.hasAttribute("unescape")) {
ret << UltimateLyricsProvider::RuleItem(UltimateLyricsProvider::RuleItem::Unescape, attr.value("unescape").toString());
}
}
reader->skipCurrentElement();
Expand Down
Loading