Page 2 of 6

Script Update: Replacing strange characters

Posted: Thu Apr 27, 2006 4:10 am
by Begges
so, here is the first update of the script (can someone remove the old code, please, as i don't know how this works)

Problem was:
-Evillyrics replaces some characters with Underscores
-till now i have found two: "'" and ","

So i have added a replace-part in the code, very simple to add new characters.

thats why i think, minilyrics is not for free:
http://www.crintsoft.com/mlbuy.htm

Code: Select all


Sub EvilTagger

'This scripts imports the Lyrics from Evillyrics
'set the Evillyrics Cache options to "Cache organization ---> by first letter"
'
'Script will check if the lyrics.txt file of the selected songs exists
'and import it then to the lyrics tag
'Filename must be "Artist - Title.txt"
'Possible erros are strange characters in the Artist or Title Tag, e.g. "C'est la vie" or "รค/22*~"

'Here are the ini-Lines
'[Eviltagger]
'FileName=Eviltagger.vbs
'ProcName=Eviltagger
'Order=10
'DisplayName=EvilTagger
'Description=Import Lyrics from Evillyrics
'Language=VBScript
'ScriptType=0


DIM path, filename
DIM list, itm
DIM headline,lyrics, line
DIM msg, errorcounter, filecounter, msgtext

'######################################################
'Set the Errorcounter to his starting point
errorcounter = 0

'Set the Path to the Evillyrics Lyrics
'Evillyrics Options must be set to "Cache organization ---> by first letter"   --> see below
path = "C:\Programme\Evillyrics\Lyrics\"
'######################################################

' Get list of selected tracks from MediaMonkey
Set list = SDB.CurrentSongList 
filecounter = list.count

' Process all selected tracks
For i=0 To list.count-1
    Set itm = list.Item(i)
	
	'##################################################
	'set the headline of the Lyrics
	headline = itm.artistname & " - " & itm.title & CHR(10) &"___________________________________" & CHR(10)
	'##################################################
	
	' Create Filename
	filename = itm.artistname & " - " & itm.title & ".txt"
	
	'####################################################
	' Evillyrics replaces some characters with underscores. Put them in here:
	filename = replace(filename,"'","_")
	filename = replace(filename,",","_")
	'####################################################
	
	
	' by adding the first letter of the artist to the path ("Cache organization ---> by first letter")
	'and then the Evillyrics scheme
    filename = path & "\" & left(itm.artistname,1) &"\" & filename
    Set filesys = CreateObject("Scripting.FileSystemObject")
	If filesys.FileExists(filename) = true Then
        Set file = filesys.OpenTextFile(filename, 1, false)
		'add headline to the beginning of the Lyrics
		lyrics = headline
		Do while not file.AtEndOfStream
			line = file.ReadLine
			lyrics = lyrics & chr(10) & line
		Loop
		'write Lyrics to the Lyrics tag
		itm.lyrics = lyrics
	Else
	errorcounter = errorcounter +1
	End if
Next
' Write all back to DB and update tags
list.UpdateAll


'#####################################################
'set the final message
msgtxt = filecounter - errorcounter & " of " & filecounter& " lyrics imported "
msgtxt = msgtxt & CHR(10)& CHR(10) & "check missing lyrics manually, e.g. filename versus artist, title tag"
'#####################################################

'final user information
Msg = SDB.MessageBox(msgtxt , mtInformation, Array(mbOk))

End sub

[/url]

Posted: Thu Apr 27, 2006 6:10 am
by trixmoto
If you register then as a member you can edit your posts. That will allow you to remove older versions in future.

Posted: Thu Apr 27, 2006 6:21 am
by DiddeLeeDoo
Looks good. New version installed, and I will give it try. Yesterday I tried it on an album with a lot of
'
in the titles, so I'll try that album again.

Posted: Mon Sep 25, 2006 1:50 pm
by xpan
I created a "EvilTagger.vbs" file in /Scripts/Auto inserting the code in here, I modified the line with the path to my EvilLyrics installation and started MM. But I don't see any lyrics.. when I play a song

what am I doing wrong?

Posted: Mon Sep 25, 2006 2:07 pm
by DiddeLeeDoo
A 'trademark' of scripts for the \MediaMonkey\Scripts\Auto\ folder is that they contain

Code: Select all

Sub OnStartup
This script is a different sort, that goes to the \MediaMonkey\Scripts\ folder, and you need to open the
Scripts.ini
file and add this section.

Code: Select all

[Eviltagger]
FileName=Eviltagger.vbs
ProcName=Eviltagger
Order=10
DisplayName=EvilTagger
Description=Import Lyrics from Evillyrics
Language=VBScript
ScriptType=0 
This is stated in the top of the script itself, I just try to make it a bit easier to understand.

So do the 'scripts.ini' editing, and copy the content of the script to a file called Eviltagger.vbs in the \MediaMonkey\Scripts\ folder.

You'll then find EvilTagger in the Tools -> Scripts menu after restaring MediaMonkey

Posted: Mon Sep 25, 2006 2:40 pm
by xpan
Ok, I am new user and some things I do not know, yet. I am learning fast, tho!! :)

Thanks a lot. It works like a charm!!

:D

Eviltagger give me this error

Posted: Wed Sep 27, 2006 11:21 pm
by dunster
Looks nice, but not yet working.
I select a mp3 song, press Tools from the menu and choose Eviltagger from the Scripts entry.
After that the next error info appear:

0 of 1 lyrics imported
check missing lyrics manually, e.g. filename versus artist, title tag

I did try it also on the album name or directory name.

Do you have any idea?
8)

Posted: Thu Sep 28, 2006 2:14 am
by Big_Berny
@duster: Does EvilLyrics show the lyric of your song? You have to play it first before EvilLyrics gets it and then you can import it.

Big_Berny

Posted: Thu Sep 28, 2006 10:15 am
by Guest
Big_Berny wrote:@duster: Does EvilLyrics show the lyric of your song? You have to play it first before EvilLyrics gets it and then you can import it.
Really strange, the same error message when I play the file, I did try already 10 different files.

Posted: Thu Sep 28, 2006 10:16 am
by dunster
Anonymous wrote:
Big_Berny wrote:@duster: Does EvilLyrics show the lyric of your song? You have to play it first before EvilLyrics gets it and then you can import it.
Really strange, the same error message when I play the file, I did try already 10 different files.

I play one file, then I go to tools/scripts/ and click on Eviltagger, then immidiately the error message come in a popup.

Forgot to login, it is me dunster.


Thanks for the help !!

Posted: Thu Sep 28, 2006 12:32 pm
by trixmoto
Do you have a file containing lyrics here...?

C:\Program Files\EvilLyrics\lyrics\B\Bonnie Tyler - Run Run Run.txt

Posted: Thu Sep 28, 2006 3:30 pm
by dunster
trixmoto wrote:Do you have a file containing lyrics here...?

C:\Program Files\EvilLyrics\lyrics\B\Bonnie Tyler - Run Run Run.txt
I see this path in the vbs file.
I try to change it to:
path = "D:\Databases\Evillyrics\Lyrics"

And I made all the directories they need, even inside the last directory Lyrics, I made the "B" directory.
After this still the same message.

Now I read the script carefully, oeilala I see something, how can I be stupid.
I thought de EvilTagger get the lyrics from the internet, but I have to make a txt file, and EvilTagger place this in the correct tag, isn't it?

Really thought EvilTagger get the lyrics from the internet.
Please don't laugh 8)

I try now the tool minilyrics, works quit fine !!
Thanks all.

Posted: Thu Sep 28, 2006 5:40 pm
by trixmoto
This script is designed to collect the lyrics which EvilLyrics downloads from the internet, and copy them into your tags. I won't laugh, promise! :lol:

Posted: Thu Sep 28, 2006 9:38 pm
by DiddeLeeDoo
I think Begges made this script, because he had used Evil lyrics for awhile, and had a rather large lyrics database there already. Then he needed a way to get them into MediaMonkey.

I tried the Evil Lyrics program for awhile, and it basically have to run while you're playing music, and then the database will build up. You can then in the weekend do an import or whatever.

Posted: Fri Sep 29, 2006 1:58 am
by trixmoto
Yes, I use EvilLyrics (and MiniLyrics has been suggested to me but it simply won't work on my laptop - no idea why - but it refuses to phone home!) so this is a useful script for me, although I've tweaked it a bit! :)