by barkoz » Wed Aug 06, 2008 1:58 am
by bob61 on Mon Mar 03, 2008 11:31 am
Any chance to modify this script to also work with
http://www.lyrics-songs.com? I've found that website has lyrics that lyricsplugin.com doesn't. I tried to go in and make the change to the URL in the original code to:
url = "
http://www.lyrics-songs.com/winamp.php?musica=" & title & "&artista=" & artist
That pulled in the lyric and displayed in in the window. However after selecting "auto tag" the lyrics weren't updated in the tag.
I have tried to do the same thing with letras.br which has very large database and came up with the same result... all the tracks appear but it fails to copy to the tag even though the Status bar indicates that it is copying to the tags
Here is the code I used
Code: Select all
' Lyrics Plugin Search script
'
' This script is a plug-in into MediaMonkey Web Search dialog. You should save it to Scripts folder as
' lyricsplugin.vbs. It has to be in Scripts.ini file, where entries can be as follows:
'
' [SearchAMG]
' FileName=letraslyrics.vbs
' ProcName=letraslyrics
' Order=99
' DisplayName=letraslyrics
' Language=VBScript
' ScriptType=3
' Global
Dim Browser
Dim Tmr
Dim Current
Dim ResultCounter
Dim TryAgain
Sub StartSearch(Panel, SearchTerm, SearchArtist, SearchAlbum)
TryAgain = 0
Set Browser = SDB.UI.NewActiveX(Panel, "Shell.Explorer")
Browser.Common.Align = 5
Dim Tracks : Set Tracks = SDB.Tools.WebSearch.NewTracks
Dim Results : Set Results = SDB.NewStringList
For i = 0 to Tracks.Count-1
Results.Add Tracks.item(i).ArtistName & " - " & Tracks.item(i).Title
Next
SDB.Tools.WebSearch.SetSearchResults Results
If Results.Count > 0 Then
ResultCounter = 0
SDB.Tools.WebSearch.ResultIndex = ResultCounter
End If
End Sub
Sub ShowResult(ResultID)
If (ResultID >= 0) Then
Browser.SetHTMLDocument ""
With SDB.Tools.WebSearch
.TrackChecked(ResultID) = True
title = .NewTracks.Item(ResultID).Title
artist = .NewTracks.Item(ResultID).ArtistName
End With
Dim pos : pos = InStr(artist, ";")
If pos > 1 Then
artist = Mid(artist, 1, pos - 1)
End If
url = "http://letras.terra.com.br/winamp.php?musica=" & Escape(title) & "&artista=" & Escape(artist)
Browser.Interf.Navigate url
Set Tmr = SDB.CreateTimer(40)
Script.RegisterEvent Tmr, "OnTimer", "WebsiteLoaded"
End If
End Sub
Sub WebsiteLoaded(Timer)
Script.UnregisterEvents Tmr
Set Tmr = Nothing
If Len(Browser.Interf.LocationURL) < 10 Then ' A trick - wait until navigation to the search results page starts
Set Tmr = SDB.CreateTimer(40)
Script.RegisterEvent Tmr, "OnTimer", "WebsiteLoaded"
Exit Sub
End If
If Browser.Interf.ReadyState = 1 Or Browser.Interf.Busy Then
Set Tmr = SDB.CreateTimer(40)
Script.RegisterEvent Tmr, "OnTimer", "WebsiteLoaded"
Exit Sub
End If
Dim Doc : Set Doc = Browser.Interf.Document
If IsObject(Doc) Then
Set lyrics = Doc.getElementById("lyrics")
If Not(lyrics IS Nothing) Then
If lyrics.innerText = "" Then
Dim NewTitle : NewTitle = SDB.Tools.WebSearch.NewTracks.Item(ResultCounter).Title
Dim NewArtist : NewArtist = SDB.Tools.WebSearch.NewTracks.Item(ResultCounter).ArtistName
If TryAgain > 0 Or (InStr(NewTitle, "(") = 0 And InStr(NewTitle, "[") = 0) Then
TryAgain = 0
Else
TryAgain = 1
Dim pos : pos = 0
pos = InStr(NewTitle, "(")
If pos > 1 Then
NewTitle = Mid(NewTitle, 1, pos - 1)
End If
pos = InStr(NewTitle, "[")
If pos > 1 Then
NewTitle = Mid(NewTitle, 1, pos - 1)
End If
NewTitle = LTrim(RTrim(NewTitle))
Browser.SetHTMLDocument ""
url = "http://letras.terra.com.br/winamp.php?musica=" & Escape(NewTitle) & "&artista=" & Escape(NewArtist)
Browser.Interf.Navigate url
Set Tmr = SDB.CreateTimer(40)
Script.RegisterEvent Tmr, "OnTimer", "WebsiteLoaded"
Exit Sub
End If
End If
TryAgain = 0
SDB.Tools.WebSearch.NewTracks.Item(ResultCounter).Lyrics = lyrics.innerText
If ResultCounter < SDB.Tools.WebSearch.NewTracks.Count - 1 Then
ResultCounter = ResultCounter + 1
SDB.Tools.WebSearch.ResultIndex = ResultCounter
End If
End If
End If
End Sub
Sub FinishSearch(Panel)
Browser.Common.DestroyControl
Set Browser = Nothing
End Sub
and entry in scripts.ini as follows
Code: Select all
[letraslyrics]
Filename=letraslyrics.vbs
Procname=letraslyrics
Order=99
DisplayName=Search for Lyrics using letraslyrics.com
Description=Searches Lyrics
Language=VBScript
ScriptType=3
I was hoping to crack this on my own but it appears i'm not smart enough
Can anyone help?
[quote]by bob61 on Mon Mar 03, 2008 11:31 am
Any chance to modify this script to also work with http://www.lyrics-songs.com? I've found that website has lyrics that lyricsplugin.com doesn't. I tried to go in and make the change to the URL in the original code to:
url = "http://www.lyrics-songs.com/winamp.php?musica=" & title & "&artista=" & artist
That pulled in the lyric and displayed in in the window. However after selecting "auto tag" the lyrics weren't updated in the tag.[/quote]
I have tried to do the same thing with letras.br which has very large database and came up with the same result... all the tracks appear but it fails to copy to the tag even though the Status bar indicates that it is copying to the tags
Here is the code I used
[code]' Lyrics Plugin Search script
'
' This script is a plug-in into MediaMonkey Web Search dialog. You should save it to Scripts folder as
' lyricsplugin.vbs. It has to be in Scripts.ini file, where entries can be as follows:
'
' [SearchAMG]
' FileName=letraslyrics.vbs
' ProcName=letraslyrics
' Order=99
' DisplayName=letraslyrics
' Language=VBScript
' ScriptType=3
' Global
Dim Browser
Dim Tmr
Dim Current
Dim ResultCounter
Dim TryAgain
Sub StartSearch(Panel, SearchTerm, SearchArtist, SearchAlbum)
TryAgain = 0
Set Browser = SDB.UI.NewActiveX(Panel, "Shell.Explorer")
Browser.Common.Align = 5
Dim Tracks : Set Tracks = SDB.Tools.WebSearch.NewTracks
Dim Results : Set Results = SDB.NewStringList
For i = 0 to Tracks.Count-1
Results.Add Tracks.item(i).ArtistName & " - " & Tracks.item(i).Title
Next
SDB.Tools.WebSearch.SetSearchResults Results
If Results.Count > 0 Then
ResultCounter = 0
SDB.Tools.WebSearch.ResultIndex = ResultCounter
End If
End Sub
Sub ShowResult(ResultID)
If (ResultID >= 0) Then
Browser.SetHTMLDocument ""
With SDB.Tools.WebSearch
.TrackChecked(ResultID) = True
title = .NewTracks.Item(ResultID).Title
artist = .NewTracks.Item(ResultID).ArtistName
End With
Dim pos : pos = InStr(artist, ";")
If pos > 1 Then
artist = Mid(artist, 1, pos - 1)
End If
url = "http://letras.terra.com.br/winamp.php?musica=" & Escape(title) & "&artista=" & Escape(artist)
Browser.Interf.Navigate url
Set Tmr = SDB.CreateTimer(40)
Script.RegisterEvent Tmr, "OnTimer", "WebsiteLoaded"
End If
End Sub
Sub WebsiteLoaded(Timer)
Script.UnregisterEvents Tmr
Set Tmr = Nothing
If Len(Browser.Interf.LocationURL) < 10 Then ' A trick - wait until navigation to the search results page starts
Set Tmr = SDB.CreateTimer(40)
Script.RegisterEvent Tmr, "OnTimer", "WebsiteLoaded"
Exit Sub
End If
If Browser.Interf.ReadyState = 1 Or Browser.Interf.Busy Then
Set Tmr = SDB.CreateTimer(40)
Script.RegisterEvent Tmr, "OnTimer", "WebsiteLoaded"
Exit Sub
End If
Dim Doc : Set Doc = Browser.Interf.Document
If IsObject(Doc) Then
Set lyrics = Doc.getElementById("lyrics")
If Not(lyrics IS Nothing) Then
If lyrics.innerText = "" Then
Dim NewTitle : NewTitle = SDB.Tools.WebSearch.NewTracks.Item(ResultCounter).Title
Dim NewArtist : NewArtist = SDB.Tools.WebSearch.NewTracks.Item(ResultCounter).ArtistName
If TryAgain > 0 Or (InStr(NewTitle, "(") = 0 And InStr(NewTitle, "[") = 0) Then
TryAgain = 0
Else
TryAgain = 1
Dim pos : pos = 0
pos = InStr(NewTitle, "(")
If pos > 1 Then
NewTitle = Mid(NewTitle, 1, pos - 1)
End If
pos = InStr(NewTitle, "[")
If pos > 1 Then
NewTitle = Mid(NewTitle, 1, pos - 1)
End If
NewTitle = LTrim(RTrim(NewTitle))
Browser.SetHTMLDocument ""
url = "http://letras.terra.com.br/winamp.php?musica=" & Escape(NewTitle) & "&artista=" & Escape(NewArtist)
Browser.Interf.Navigate url
Set Tmr = SDB.CreateTimer(40)
Script.RegisterEvent Tmr, "OnTimer", "WebsiteLoaded"
Exit Sub
End If
End If
TryAgain = 0
SDB.Tools.WebSearch.NewTracks.Item(ResultCounter).Lyrics = lyrics.innerText
If ResultCounter < SDB.Tools.WebSearch.NewTracks.Count - 1 Then
ResultCounter = ResultCounter + 1
SDB.Tools.WebSearch.ResultIndex = ResultCounter
End If
End If
End If
End Sub
Sub FinishSearch(Panel)
Browser.Common.DestroyControl
Set Browser = Nothing
End Sub[/code]
and entry in scripts.ini as follows
[code][letraslyrics]
Filename=letraslyrics.vbs
Procname=letraslyrics
Order=99
DisplayName=Search for Lyrics using letraslyrics.com
Description=Searches Lyrics
Language=VBScript
ScriptType=3[/code]
I was hoping to crack this on my own but it appears i'm not smart enough :( :( :(
Can anyone help?