Newbie-Script: Import lyrics from Evillyrics (check code,pls

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

Begges

Script Update: Replacing strange characters

Post 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]
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

If you register then as a member you can edit your posts. That will allow you to remove older versions in future.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post 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.
Image
xpan
Posts: 17
Joined: Sun Sep 17, 2006 1:48 pm

Post 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?
DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post 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
Image
xpan
Posts: 17
Joined: Sun Sep 17, 2006 1:48 pm

Post 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
dunster
Posts: 8
Joined: Wed Sep 27, 2006 11:14 pm

Eviltagger give me this error

Post 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)
cougar - dunster crew
Big_Berny
Posts: 1784
Joined: Mon Nov 28, 2005 11:55 am
Location: Switzerland
Contact:

Post 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
Image
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP
AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
Guest

Post 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.
dunster
Posts: 8
Joined: Wed Sep 27, 2006 11:14 pm

Post 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 !!
Last edited by dunster on Thu Sep 28, 2006 3:47 pm, edited 1 time in total.
cougar - dunster crew
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Do you have a file containing lyrics here...?

C:\Program Files\EvilLyrics\lyrics\B\Bonnie Tyler - Run Run Run.txt
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
dunster
Posts: 8
Joined: Wed Sep 27, 2006 11:14 pm

Post 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.
cougar - dunster crew
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post 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:
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post 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.
Image
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post 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! :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Post Reply