Bug 486370 - embed lyrics
Summary: embed lyrics
Status: RESOLVED FIXED
Alias: None
Product: kid3
Classification: Applications
Component: general (other bugs)
Version First Reported In: 3.9.x
Platform: Debian stable Linux
: NOR major
Target Milestone: ---
Assignee: Urs Fleisch
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-30 23:20 UTC by nekto
Modified: 2025-07-24 16:31 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
attachment-2533283-0.html (2.24 KB, text/html)
2024-05-02 13:33 UTC, nekto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nekto 2024-04-30 23:20:58 UTC
embed lyrics does not search for song lyrics, it doesn’t find any at all, starting from version kid3-3.9.3 :( although clementine finds all the lyrics on the same resource. Please fix it!
Comment 1 Urs Fleisch 2024-05-02 05:25:49 UTC
The HTML class has changed. Try the following change:

--- a/src/qml/script/EmbedLyrics.qml
+++ b/src/qml/script/EmbedLyrics.qml
@@ -71,9 +71,9 @@ Kid3Script {
                    "/" + encodeURIComponent(title)
         },
         parseResponse: function(resp) {
-          var begin = resp.indexOf('<div class="cnt-letra">')
+          var begin = resp.indexOf('<div class="lyric-original">')
           if (begin !== -1) {
-            begin += 23
+            begin += 29
             var end = resp.indexOf("</div>", begin)
             var txt = resp.substring(begin, end).trim()
             if (txt.substring(0, 3) === "<p>") {
Comment 2 nekto 2024-05-02 13:33:55 UTC
Created attachment 169102 [details]
attachment-2533283-0.html

thank you, but I can’t do it, because I really don’t understand how it
should be correctly :( please send me the ready-made EmbedLyrics.qml script
on sergantiche@gmail.com :)

чт, 2 мая 2024 г. в 08:25, Urs Fleisch <bugzilla_noreply@kde.org>:

> https://bugs.kde.org/show_bug.cgi?id=486370
>
> Urs Fleisch <ufleisch@users.sourceforge.net> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>      Ever confirmed|0                           |1
>              Status|REPORTED                    |CONFIRMED
>
> --- Comment #1 from Urs Fleisch <ufleisch@users.sourceforge.net> ---
> The HTML class has changed. Try the following change:
>
> --- a/src/qml/script/EmbedLyrics.qml
> +++ b/src/qml/script/EmbedLyrics.qml
> @@ -71,9 +71,9 @@ Kid3Script {
>                     "/" + encodeURIComponent(title)
>          },
>          parseResponse: function(resp) {
> -          var begin = resp.indexOf('<div class="cnt-letra">')
> +          var begin = resp.indexOf('<div class="lyric-original">')
>            if (begin !== -1) {
> -            begin += 23
> +            begin += 29
>              var end = resp.indexOf("</div>", begin)
>              var txt = resp.substring(begin, end).trim()
>              if (txt.substring(0, 3) === "<p>") {
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 3 nekto 2024-05-08 15:20:34 UTC
An unpleasant detail was revealed. if the song title contains the characters: ' " / ( [, the text is not found, but if these characters are removed from the title, then the song text is found 🤔
Comment 4 Urs Fleisch 2025-07-24 16:31:46 UTC
Fixed in version 3.9.7.