Lyrics Manager

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

0
5.0
Description:

About:

This script is intended to extend amaroK lyrics operations. The main actions are:
* Edit lyrics with external editor
* Automatic text cleanup
* Export lyrics to file
* Import lyrics from file
* Mass import and export
* Erase and fill up lyrics
You can select menu items and features that you need. Also you are required to setup editor and storage directory depending on your previous choice. All these parameters are saved in config file and loaded silently at script startup.
Script will take care of HTML break tags while processing lyrics text, so you can edit and store plain text.
Mass operations could be used to backup and restore cached lyrics. Fill up feature prevents automatic lyrics fetching.
For more information see description on the homepage.


Dependencies:

amaroK >= 1.4.3
PERL >= 5.8
KDialog >= 1.0 (optional: for GUI configuration)

Tested on: amarok 1.4.10; perl 5.8.8; kdebase 3.5.9.
Last changelog:

11 years ago

version 0.2.14
* fix: bug in collection search algorithm for device paths containing special chars

version 0.2.13
* update: improved flexibility of collection search algorithm

trawler

14 years ago

Same here - I'm using Amarok 1.4.3, using KDE 3.5.5 on Ubuntu edgy (6.10).

Report

trawler

14 years ago

P.S. - updating the script didn't help...

Report

digitalramble

14 years ago

I can't quite tell from this writeup. Does this utility use the USLT tag in id3v2 to write out the lyrics to? Or is this more of a meta association, pulling up lyrics in the browser while playing?

I want to get USLT tags set up so I can export to the iPod.

thanks!

Report

C

msan

14 years ago

No, this script does not use any id3 tags. It deal with amaroK database, which contains rich information about your collection and lyrics in particular.

There are earlier comments about ipod in this discussion, may be they can help you. Also it seems to me that some months ago I've met amaroK script, that write lyrics to USLT, but I'm not sure.

Report

ciasa

14 years ago

It would be nice if this script would automatically export the lyrics when they are fetched from the server. I usually just play my whole collection randomly, so its not practical to have to right click on each song and choose to export the tracks lyrics.

Report

C

msan

14 years ago

Unfortunately, there is no way to do so. Technically I can't recognize from my script when lyrics were fetched by another script.

Report

ciasa

14 years ago

I'm not familiar with the limits of scripting in amarok, but would it be possible to check to see if:

*the song has changed
*the lyrics have been fetched at all (by checking the length of the lyrics)

If so, then a simple hack would be to wait X number of seconds after a song change to automatically export (if lyrics length is not 0).

Report

C

msan

14 years ago

Yes, it's possible. But this change is not very simple as it requires additional thread or process for waiting. Actually, I havn't written such things on perl yet, so you have to wait some time for the implementation. You can use mass export meanwhile.

Report

bitcrazy

14 years ago

Hi,
fkirst thank you for this script. But I have a little problem with artist names, that contain slashes. Seems, that they aren't escaped in your script. I'm not a perl programmer, so I can't fix it for myself. Just an example AC/DC-TNT.txt would lead to a file not found error, 'cause of the slash.

Thanx

m0nk

Report

C

msan

14 years ago

Hi!

You can't place slash symbol in file names because it used in paths as a separator. It's a system restriction. 'AC/DC - TNT.txt' is considered as 'DC - TNT.txt' file in 'AC' subdirectory (you get an error, because this subdir is not exist).

Solution to this problem could be a slash replacing in file name. For ex., the name of text file would be 'AC-DC - TNT.txt' or 'AC%DC - TNT.txt'. If you like this, I could implement it...

If you have another proposal, let's discuss it!

Report

Hirs

14 years ago

It's perfect to add lyrics to ipod notes, only point export lyrics dir to your ipod notes directory

Thank you!

Report

DrMartinus

14 years ago

Hi,

I wanted to test this skript - it seems to be a good way to solve my problems. I can enter lyrics in files, they are saved (I just checked), but I have no idea how to make them visible again. When I click on "import" in the context menu, nothing happens, but I'd rather have this load the texts automatically.
Won't it work like any of these lyrics skripts that fetch lyrics from web servers?

Thanks for your help!

Martin

Report

C

msan

14 years ago

Current version of Lyrics Manager can't autoload texts from files when song starts playing. But I think it's a great idea to adopt fetching lyrics mechanism for implementing such a feature. Fetching lyrics event is implemented in unstable amaroK 1.4 releases, those are not fully documented for now, however I'll try to check this out and if it could be adopted, I'll include support for this feature in next few releases of the script.

When you click "import", the script loads file contents to amaroK database. The loaded text should be visible in lyrics tab during the next track playing.

Also it is known issue that you import current track lyrics and lyrics tab is not autorefreshing (you need to relaunch song playing to see the text), but I don't know the way to walk around. If someone could help me with this issue, please, contact me!

I'm currently developing next version of the script with mass import and export support. Maybe it would be more suitable for your needs, because you can edit many files and than import them to amarok in one click!

Report

sugnacamrevyg

14 years ago

Hi,
maybe your problem is the same I've noticed yesterday. Some cached lyrics were shown, some not. I than understood, that only the lyrics I imported with your script were not shown. That is because the lyrics string that is saved was changed in 1.4. In the lyrics_text_to_amarok routine, you add br to every end of line. But amarok firstly needs correct xml for this string and secondly does this itself. So you shouldn't change the lines and all is perfect.

Report

C

msan

14 years ago

Thank you very much for telling me about 1.4 version changes! I had some problems with 1.4 beta releases, beta2 is not working for me now, so I can't check it up by myself... I'll try to set it up soon and to fix the script.

And there is no such simple solution as to cancel concatenation of br tags, because of amarok 1.3 users, those have different lyrics processing in player. There should be lyrics processing dependent on version number.

Report

panzi

14 years ago

In amarok 1.4 you display & set lyrics of the current son by:

dcop amarok contextbrowser showLyrics 'text text
text text

text text'

Or if you whant to display suggestions:
dcop amarok contextbrowser showLyrics ''

When a suggestion is clicked your script receives the event:
fetchLyricsByUrl

The url-argument will be cgi-encoded, which makes problems wth local urls (because they CAN contain spaces etc. and they can contain %20).
I Made a workarround:
I used python's urllib to encode (quote) it myself so that no character is contained which amarok encodes and even %xx parts are encoded (%25xx) and then I decode it in the fetch-event.

See my Local Lyrics fetcher (and two others, bundeld in one package) for amarok 1.4:
http://kde-apps.org/content/show.php?content=38120

Report

panzi

14 years ago

hmpf, all XML tags where striped from my description. I added a description on how to set lyrics/suggestions in the amarok-wiki.
see: http://amarok.kde.org/amarokwiki/index.php/Script-Writing_HowTo

Report

panzi

14 years ago

If you would not have much time to write it, I'm about to do it (or maybe someone else, who cares).

Wel I don't have any time to write it. But I still write it. (I'm so screwed)

Report

C

msan

14 years ago

Thank you! It's very interesting and useful information. contextbrowser.showLyrics is a complete solution to refresh problem.

I've tested some notifications and dcop calls. They work. But I've noticed that new amaroK 1.4 notifications are sent not only to 'type=lyrics' scripts. My script could handle it too. It's a bad practice to use it, I think, because it would conflict with running lyrics script... It's not fair to set type of my script to 'lyrics', because the main aim of the script is not to fetch local lyrics, though I'm about to implement automatic import somehow :). By setting 'lyrics' type I deny other fetching scripts to run at the same time.

Some months ago, when I had read about lyrics fetching, tried it and discovered this constraint (to run only one 'type=lyrics' script), the idea of a script collection came to me. It is the same, I think, as fredlefred wrote in discussion in mini-forum of the Panzi's Lyrics script. I am trying to show the importance of such script and the value of this constraint. Your script (Panzi's Lyrics) is a great step towards. If you would not have much time to write it, I'm about to do it (or maybe someone else, who cares).
Imho it must be implemented in amaroK as an internal feature.

Report

DrMartinus

14 years ago

sorry, just to complete my first comment:

Lyricsmanager returns a message that the text has been imported, so actually it should become visible at one place, shouldn't it?

Report

SloppyNick

14 years ago

I ran the perl script, and set up the configuration file, which lives in:
~/.kde/share/apps/amarok/scripts-data

Here is the contents of my conf file:

# Lyrics Manager configuration
# preffered editor
editor=kwrite
# texts directory
texts_dir=~/.kde/share/apps/amarok/lyrics
# 'export after edit' flag (0/1)
export_after_edit=1


The popup menu in amaroK doesn't have the extra options unless the perl script is running. Is this intended? Also, clicking on the menu items doesn't seem to have any effect. Any ideas?

Report

C

msan

14 years ago

It seems to me that you're running perl script from command line. You need amaroK Script Manager (launched from Tools->Script Manager) to setup this script properly. Choose Install script and select downloaded archive, than choose Run.

The second thing is that perl don't understand paths, those are begun with '~', that's why you need global path (starting with '/') for texts directory. If you have KDialog and use GUI configuration, than there is no worries. I'll include support for a '~' in future versions.

Report

SloppyNick

14 years ago

Yeah, the problem was that I was running the script from the command line.

Also, I had my global path, I just substituted ~ for privacy reasons.

One suggested fix is to allow a user to enter a hidden folder as the lyrics directory. I tried to do this from the configuration screen, but when I clicked OK, nothing happened. I suspect this was because the File Chooser couldn't display the folder, because it was hidden. Howver, it was easily fixable in the configuration file later.

So now it works. Thank you! Two thumbs up!!

Report

C

msan

14 years ago

To select hidden directories you just need to turn on this feature in popup menu in Directory chooser. Afaik, it is true for all standard KDE choosers.

Report

migsy

14 years ago

I get an error, during the initial configuration, saying can't write config file. How do I write a config file manually?

Report

11 years ago

version 0.2.14
* fix: bug in collection search algorithm for device paths containing special chars

version 0.2.13
* update: improved flexibility of collection search algorithm

12345678910
Be the first to comment
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
0.2.14
updated Dec 02 2009
added Feb 23 2006
downloads 24h
0
mediaviews 24h 0
pageviews 24h 4
System Tags addon