Lyrics ID3

Amarok 1.x Scripts

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

1
5 .8
Description:

Die deutsche Übersetzung der Skriptbeschreibung:
http://www.gansinger.net/lyricsID3/README.de.xhtml

Français:
http://www.gansinger.net/lyricsID3/README.fr.xhtml

Italiano:
http://www.gansinger.net/lyricsID3/README.it.xhtml

Available Languages
The script is available in:
- English
- German
- French
- Italian
- Czech
Read Lyrics from ID3
his is a lyrics script for Amarok. In contrast to many other lyrics scripts, it fetches the lyrics not from the Internet. It uses the possibility to store lyrics in the ID3 tag of mp3 files (USLT frame). So if there are lyrics stored in file and this script is running, Amarok will display the lyrics.
ID3v2 allows to store multiple lyrics in one file. They are separated by different language codes and/or comments. In this case the script let you choose between the different lyrics by a simple click.

Additionally there is a rudimentary support for Vorbis Comments and FLAC Comments. It is possible to specify a key value (the default is LYRICS). The first comment containg the keyword will be read out and displayed as lyrics in Amarok.

As for Ogg Vorbis there is a feature for reading lyrics in m4a (mp4 (AAC)).

Many lyrics contain characters, which are not in the range of ASCII. In order to handle these characters, you should use a appropriate standard out encoding, like UTF-8 or Latin1.

There is no configuration required by the script.

Save Lyrics to ID3
With this script you can save the lyrics of a song in the ID3v2.4 tag of a mp3-file. If you use a mp3-player which can read this tag (USLT frame in ID3), it will display the lyrics.
To store the lyrics, two options have to be specified: a three letter language code (ISO 839-2) and a comment or description of the lyrics. This script provide to modes on how to save the lyrics. These modes are Automatic Mode and Manual Mode. Additionally you can delete already stored lyrics.
All lyrics are stored in UTF-8, which require ID3v2.4. So all tags with versions 2.x will be updated to v2.4. If there is only a ID3v1.1 in the file, an additional tag will be created. If there is no tag at all, no lyrics will be stored.
Many lyrics contain characters, which are not in the range of ASCII. In order to handle these characters, you should use a appropriate standard out encoding, like UTF-8 or Latin1.

Automatic Mode
In this mode the lyrics are stored automatically. Every time Amarok starts a new song the scripts waits a specified time then it fetches the lyrics and stores them in the file. For a successful use of this mode, you have to configure some stuff. First of all you need the specify a language code and a description which will be used. Second you have to specify a waiting time. This represents the time between a track change and the start of the storing process. The amount of seconds is calculated by the song length divided by waitTime. Thus a bigger the value of waitTime leads to a shorter time between a track change and the storing process.
All these configurations can easily be done with the configuration dialog provided by the script. To use this, mark the script in the script manager in Amarok and click on configure (the script has to be in running mode).
If you to disable the Automatic Mode you can easily do this during the configuration process.

Manual Mode
- Saving Lyrics -
You can also save the lyrics manually. For this you can use the context menu entry: saveLyrics. The action is always based on the selcted songs in the playlist. If you click on saveLyrics, you will get a dialog where you can specify the language code, description and lyrics.
If there are already lyrics and the file, the dialog will show the language code and the description of the lyrics in the file. The displayed lyrics are always the ones, which Amarok displays in the context browser. To overwrite the lyrics just acknowledge the dialog. If you specify new options, the lyrics will be stored additionally except Change Comment is not checked. If this is checked, the lyrics will not be stored additionally. The lyrics will be stored with the same language key and a different comment. So the previous lyrics will be deleted in the file. If there are more than one lyrics with the selected language key in the file, just one will be overwritten.
- Deleting Lyrics -
This works like the saving process. If you use the context menu entry removeLyrics a dialog will show up. In this dialog you can specify the language code and the description of the lyrics which should be deleted.


Dependencies
Python 2.2, 2.3, 2.4 or 2.6Python Mutagen (http://code.google.com/p/mutagen/)pyhton-qt3Python MinidomPython urllibkdialog

Warning
The lyrics are stored in the mp3-File. I can not guaranty that the file is not damaged after the writing process.
The file type is only verified by extension.

Translators wanted
I am looking for translators. So if you want to contribute, translate the script in your favorite language and send me the result. I will release your translation with the script.
If you have experience with translation and gettext you can use messages.pot provided with the script. Otherwise you can contact me and I'll explain how to do the translation.

Previous Versions
Previous Versions of the script can be found at:
http://stifi.st.ohost.de/scripts/

Save Lyrics to ID3 Button
By applying this patch to the Amarok source code you will get an additional button in the lyrics tab. By pressing this button you can save the lyrics directly into the mp3 file. This button avoids the inconvenient context menu approach.
http://gansinger.net/lyricsID3/savebuttonpatch.html

Feedback is appreciated and please report any bugs.

Finally, thanks to every contributer!
Last changelog:

8 years ago

Version 1.8-beta
Bug fix in XML processing by madli *thanks*
Version 1.8-alpha (cs)
Czech translation from Pavel Fric *thanks*
Version 1.8-alpha
KApplication and kdialog is not needed anymore (-->Script should now work with newer versions of python and kde)Removed automatic installer for python-mutagen
Version 1.7
corrected link in README to French translationItalian translation and some spell checks from Marco Poletti *thanks!*
Version 1.6a
small bug fix version
Version 1.6
french translation by pgraber *thanks!*set STD_ENCODING to ASCII as default
Version 1.5
some unicode fixes on notifiactionsdisabled debug output by default
Version 1.4
new Iconfixed character sets errors in mass tagging
Version 1.3
support for FLACconfigurable key name for FLAC/Vorbisadded Mass Tagging Featurethe action is now based on the selected songs in the playlistConfiguration Dialog
Version 1.2a
removed popup if no lyrics are found
Version 1.2
removed debug(lyrics)reading support for m4ausing mutagen for Ogg VorbisTimer for Automatic Mode is stopped, if Amarok stops playing the song.
Version 1.1
started with translation (gettext)If mutagen is not installed, the scripts tries to install it.READMEs are in well formated XHTMLAutomatic Mode can be disabledchanging comments is now possiblesome structural changes in the codevery small bug fixesall dialogs are now in front by default
Version 1.0
error message on wrong language code was always shown after configuring the script
Version 0.9
spec-filebetter description of the script behaviourpoliter messagesnon-ASCII characters in comments are handledsmall bug fixes
Version 0.8
exit gracefully on stopautomatic mode did not work
Version 0.7
removed dependency of dcop lib (which caused many problems for python2.5 users)saving in vorbis is deactived by default, because I have no time to maintain this script
Version 0.6
many encoding fixes (thanks to aeternos)
Version 0.5
GUI for configurationimproved the dialog for saving the lyricsyou can now edit the lyrics before savingbetter dialog for deleting the lyrics
Version 0.4
added non ISO language codeswaiting time is now configurable(click on 'configure' to initialize your configuration-file)new configure option: commentcleaned up code
Version 0.3
removed pause optionsmall bug fixes
Version 0.3alpha
initial release with python-mutagen

ZeroUser

8 years ago

I've not found any installation manual. Please, explain, hot to setup this wonderful script to Amarok. Thanks in advance.

Report

C

stifi

8 years ago

Just download the script and install it by using Amarok's script manager.

For detailed questions, write me an E-Mail. I'll try to answer them.

Report

jmmzon

9 years ago

Sorry for my bad Engilsh. I have a question. Does this script will run once in Amarok 2 or not? Without this script Amarok is useless.

Report

C

stifi

9 years ago

No, the script is incompatible with Amarok 2.

Options:
- Stay at Amarok 1.4
- Vote at: http://code.google.com/p/clementine-player/issues/detail?id=1110 and hope that the developers implement this feature soon
- Switch to Guyadeque

Report

etechnophile

8 years ago

Unfortunately it turns out that it's quite impossible to accomplish with an Amarok 2 script due to limitations of the api. See http://forum.kde.org/viewtopic.php?f=117&t=90708

Instead, you can use:
https://github.com/HaMF/amarok_id3lyrics

Report

NioS

11 years ago

Hello ! I've still Amarok 1.4.10 on my Kubuntu-KDE4.3.2 but I can't get this script working. I used to use it before, even with KDE 4.2.4, but now it's not working anymore.
Maybe I haven't got the good version of Python (the latest is 2.6, whereas Lyrics ID3 works with 2.4 max)

When I launch the "Save" script in a shell, I get : "sh: Syntax error: Unterminated quoted string"

Yet, I think I've installed all the required packages...
Please help !

Report

wpeaton

10 years ago

I know a lot of time has passed since this post. But it is still true that Amarok 1.4 is the best music player. And it is still true that the ID3 scripts are really great.

Unfortunately, they don't run on Python 2.6. If I could figure out the offending lines, I could maybe fix them. I don't even know where to start.

Has anyone found a solution?

Report

C

stifi

10 years ago

I am the author of the scripts. Maybe I am able to help to get the scripts running. The problem is that I have no KDE and Amarok on my system. You can write me an E-Mail with some error messages and system stats. I see what I can do. As I remember was there a bug in the python-qt libraries causing a segmentation fault. In that case I am not able to help you. But just give it a shot. Maybe we find a suitable solution for you.

Report

bugmenot1234

10 years ago

Hallo Stefan,
funktioniert ja wieder prächtig! Vielen Dank dafür und schöne Grüße aus Vienna,
Flow

Report

C

stifi

11 years ago

It seems that you discovered a bug in my script. Unfortunately I stopped using KDE and Amarok. I think there are some complications with some libraries. If you want you can write me an E-Mail and I'll help you to debug the script. Anyway my advise is to look for an alternative music player with lyrics support because Amarok 1.x (with Scripts) and KDE 4.x isn't a good combination in my opinion.

Report

sacrediou

11 years ago

First of all, thanks a lot for this great script !

I've seen "support for FLAC" in version 1.3 on the online changelog of this tool but the feature seems to be absent of version 1.7 that I'm using... and in its changelog too !

Did you take the decision to drop this feature, or is it a mistake ?

Hope to see a fix/workaround, because I love this script for mp3 and it would be wonderful if it's possible to do the same with flac.

It's a shame that there's still no standard for embedded lyrics in ogg vorbis and flac. Hope to have one someday...

Keep the good work :-)

Sacrediou

Report

C

stifi

11 years ago

Sorry, but FLAC is only supported in a rudimentary way. If lyrics are stored in a FLAC file with comment 'LYRICS' they are read out and shown in Amarok. As you already mentioned, is there no standard on how to store lyrics in FLAC. So it is very unlikely that you have FLAC files with lyrics stored with the comment LYRICS. Writing lyrics with my script in FLAC files is not supported. Since I am not using FLAC I will not implement that feature because testing would be insufficient. Sorry, for any confusion caused by my Change-log.

Report

sacrediou

11 years ago

OK, I understand. I'll try writing lyrics with other tool and use Lyrics ID3 to see it in Amarok.

Thank you for your answer... and your very good script :-)

Report

vinci

11 years ago

One advice : under debian/ubuntu you need the following packages :

python (obvious) python-kde3 python-urljr python-xml python-mutagen

It took me some time to guess that python-kde4 was not the required one ;) The message was quite cryptic :
sh: Syntax error: Unterminated quoted string


Report

C

stifi

11 years ago

Thnx for the bug report. Unfortunately, there are many changes in package names since KDE4 was released. Additionally, is Gnome the standard desktop in Ubuntu which results in some missing packages (eg kdialog is not available by default, at least at my desktop). I'll try to find a way to solve the package clutter.
Anyway, I'm happy that you solved the problem on your own and sorry for any inconvenience.

Report

arvenil

12 years ago

Great script! Thanks for it!
Two questions:
1. Are there any tools for linux which can also edit those lyrics tags in id3?
2. Are there other players which use lyrics tags?

Report

compulsechris

11 years ago

2) Songbird does with add-ons. Also has an add on for batch tagging with lyrics. (But get fasterbird first.)

Report

v6lur

12 years ago

1 - Kid3: http://kde-apps.org/content/show.php/Kid3?content=10415
(2 - don't know)

Report

sodrian

12 years ago

Thanks for such a great script! But I want to ask one question. When flac support will be implemented? There is already a lot of tag editors that support writing and reading flac lyrics. Why not adding this feature to your script?
Thanks.

Report

edybsd

12 years ago

In file read_lyrics_from_id3.py,
method lyrics2xml
the following line:

artist = kwargs['title']

should be

artist = kwargs['artist']

By the way, great script...

Report

C

stifi

12 years ago

Thanks for the report. I'll change that for the next release.

Report

sefrot

12 years ago

I have this error and I don't know what packages install in debian

Report

C

stifi

12 years ago

You need: python-kde3

Report

mortenwendelboe

12 years ago

I have made a few changes to save_lyrics_to_id3.py i order to make the script save the lyrics i a ogg-file. As I only save lyrics (and don't remove lyrics), I just made the changes to the saving part. I can send you the changed file if you are interested.

/Morten Wendelboe

Report

C

stifi

12 years ago

Yes please send it to me and I'll have a look on it. If you have time and you'll feel in mood please add the "deleting-feature" to round out the feature list. Thanks for your efforts.

Report

8 years ago

Version 1.8-beta
Bug fix in XML processing by madli *thanks*
Version 1.8-alpha (cs)
Czech translation from Pavel Fric *thanks*
Version 1.8-alpha
KApplication and kdialog is not needed anymore (-->Script should now work with newer versions of python and kde)Removed automatic installer for python-mutagen
Version 1.7
corrected link in README to French translationItalian translation and some spell checks from Marco Poletti *thanks!*
Version 1.6a
small bug fix version
Version 1.6
french translation by pgraber *thanks!*set STD_ENCODING to ASCII as default
Version 1.5
some unicode fixes on notifiactionsdisabled debug output by default
Version 1.4
new Iconfixed character sets errors in mass tagging
Version 1.3
support for FLACconfigurable key name for FLAC/Vorbisadded Mass Tagging Featurethe action is now based on the selected songs in the playlistConfiguration Dialog
Version 1.2a
removed popup if no lyrics are found
Version 1.2
removed debug(lyrics)reading support for m4ausing mutagen for Ogg VorbisTimer for Automatic Mode is stopped, if Amarok stops playing the song.
Version 1.1
started with translation (gettext)If mutagen is not installed, the scripts tries to install it.READMEs are in well formated XHTMLAutomatic Mode can be disabledchanging comments is now possiblesome structural changes in the codevery small bug fixesall dialogs are now in front by default
Version 1.0
error message on wrong language code was always shown after configuring the script
Version 0.9
spec-filebetter description of the script behaviourpoliter messagesnon-ASCII characters in comments are handledsmall bug fixes
Version 0.8
exit gracefully on stopautomatic mode did not work
Version 0.7
removed dependency of dcop lib (which caused many problems for python2.5 users)saving in vorbis is deactived by default, because I have no time to maintain this script
Version 0.6
many encoding fixes (thanks to aeternos)
Version 0.5
GUI for configurationimproved the dialog for saving the lyricsyou can now edit the lyrics before savingbetter dialog for deleting the lyrics
Version 0.4
added non ISO language codeswaiting time is now configurable(click on 'configure' to initialize your configuration-file)new configure option: commentcleaned up code
Version 0.3
removed pause optionsmall bug fixes
Version 0.3alpha
initial release with python-mutagen

12345678910
1
product-maker posixru May 29 2012 9 excellent
Be the first to comment
aspotashev
Aug 18 2011
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
1.8-beta
updated May 28 2012
added Nov 27 2006
downloads 24h
1
mediaviews 24h 0
pageviews 24h 4
System Tags addon