DonationCoder.com Forum

DonationCoder.com Software => Coding Snacks => Post New Requests Here => Topic started by: fatjoe on May 09, 2006, 01:17 AM

Title: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: fatjoe on May 09, 2006, 01:17 AM
Well basically some of ya's may or may not know that mp3 ID3 tag can store lyrics for songs too. I'm wondering if anyone can create a program that you specify a directory of mp3s and it reads each mp3 one by one getting the Artist & Title from ID3 tag and then searching a site/ a few sites like http://www.elyricsworld.com/ or various others and just downloading the lyrics for that song if any matches are found and yeah just adding that to the ID3 tag of the song.

Would be pretty cool cause then when you're playing your songs with programs like mediaplayer or winamp you can use a plugin / built in and view the lyrics of the song too.

Sure beats finding the lyrics for all the songs in your library one by one  :-\
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: mouser on May 09, 2006, 01:53 AM
love the idea..
does it already exist i wonder?

i know that seedling has made recently an mp3 tool on this site(random mixtape maker), so maybe this is a good task for him if it doesn't exist already.
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: fatjoe on May 09, 2006, 02:36 AM
yeah theres a program called Zortam MP3 Studio which has a feature where you can batch download lyrics. The problem is that the program is pretty useless cause it has I think only one lyric source which has a very limited supply of lyrics.

So yeah it'd be cool if someone did something similar to that prgoram but managed to implement maybe a few good lyric sites like elyricsworld.com which has something like 130,000 lyrics. Few of those sites and you'd have one hell of a program.
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: fatjoe on May 12, 2006, 07:49 AM
willing to donate a few bling blings if that's what it'll take to get this done. Shouldn't be too hard to create
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: app103 on May 12, 2006, 08:13 AM
There is a plugin for Winamp that I have been using for years called Lyrc. It fetches the lyrics from the Lyrc database when the song starts playing...displays the page in the Now Playing window in Winamp 5 or the mini-browser in Winamp 2.

It's available for a few other players too...and open source.

Nice thing about this, is that it's a user built database. If they don't have the lyrics for something, you can do a google search, find them, and then submit them yourself right from within Winamp. The more people use it the better it gets.

Another nice thing about it is that it's not just limited to mp3...this will display lyrics for CD's you play too. It's all based on what you see in the playlist window for the track playing.

http://lyrc.com.ar (http://lyrc.com.ar)
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: fatjoe on May 13, 2006, 12:05 AM
Yeah my main problem is I want to do this without playing the song. I just want to run it and get it to try find lyrics for my entire mp3 library i define ~
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: fatjoe on May 17, 2006, 08:10 AM
$10 paypal or donation credits or whatever you guys callit for person who can do this.

Nothing fancy. Just select a directory, maybe a checkbox for search lyrics for songs in subfolders also. Then just one at a time grab a song in the folder & seek lyrics for it based on title & artist in the ID3 tag from a few lyric sites like elyrics.net & elyricsworld.com etc and if found add it to the Lyrics section of the ID3 tag.
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: skrommel on May 17, 2006, 08:41 PM
 :) I started building this app, using a command line mp3 tag tool, but it turns out that the tool crashes while writing the info back, so I started looking for an alternative, and of course someone has built this before. Try http://www.tagrunner.com (http://www.tagrunner.com) for one of them.

Skrommel
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: skrommel on May 17, 2006, 09:21 PM
 :) But if anyone can make the Tag.exe tool work, here's AddLyrics's source code.
I've changed it to download the lyrics to the same name as the MP3, but using the .txt extension.

Remember to download Tag.exe and place it in the same folder as the script.

Skrommel

;AddLyrics.ahk
; Downloads the lyrics of MP3 files
; Uses Tag.exe from http://www.softpedia.com/get/Multimedia/Audio/Tag-Editors/Tag.shtml
;Skrommel @2006


#SingleInstance,Force
#NoEnv
SetBatchLines,-1

If 0=0
{
  MsgBox,0,AddLyrics - 1 Hour Software,Command line: `tAddLyrics <path to mp3(s)> [Recurse Replace]`nExample: `t`tAddLyrics "C:\MP3\*.mp3" Recurse Replace`n`nRecurse=Recurse into subfolders`nReplace=Replace exsting lyrics`n`nwww.1hoursoftware.com
  ExitApp
}

path=%1%
recurse=0
If (2="recurse" Or 3="recurse")
  recurse=1
replace=0
If (2="replace" Or 3="replace")
  replace=1

Loop,%path%,0,%recurse%
{
  TrayTip,AddLyrics,%A_LoopFileLongPath%
  SplitPath,A_LoopFileLongPath,name,dir,ext,name_no_ext,drive
input="%A_LoopFileLongPath%"
  output=%dir%\%name_no_ext%.txt
  Gosub,RETRIEVE
}
ExitApp


RETRIEVE:
file:=CMDret_RunReturn("Tag.exe " input)
StringGetPos,start,file,Artist:
If start<0
  Return
start+=10
StringGetPos,stop,file,`n,,% start
StringMid,artist,file,% start,% stop-start
StringReplace,artist,artist,%A_Space%,+
Loop
{
  StringGetPos,start,artist,++
  If start<0
    Break
  StringReplace,artist,artist,++,+,All
}

StringGetPos,start,file,Title:
If start<0
  Return
start+=10
StringGetPos,stop,file,`n,,% start
StringMid,title,file,% start,% stop-start
StringReplace,title,title,%A_Space%,+,All
Loop
{
  StringGetPos,start,title,++
  If start<0
    Break
  StringReplace,title,title,++,+,All
}

lyricsexist=1
StringGetPos,start,file,Lyrics:
If start<0
  lyricsexist=0

file=http://search.azlyrics.com/cgi-bin/azseek.cgi?q=%artist%+%title%

UrlDownloadToFile,%file%,file.htm
FileRead,file,file.htm
StringGetPos,start,file,<b>1.</b>
If start=0
  Return
StringGetPos,start,file,<a href=",,% start
start+=10
StringGetPos,stop,file,",,% start
StringMid,file,file,% start,% stop-start+1
TrayTip,AddLyrics,%file%

UrlDownloadToFile,%file%,file.htm
FileRead,file,file.htm
StringGetPos,start,file,"</b>
start+=9
StringGetPos,stop,file,`n<BR><BR>,,% start
StringMid,file,file,% start,% stop-start-2

tag=0
lyrics=
Loop,Parse,file
{
  If A_LoopField=<
  {
    tag=1
    Continue
  }
  If A_LoopField=>
  {
    tag=0
    Continue
  }
  If tag=0
    lyrics:=lyrics A_LoopField
}
If (lyrics<>"" And (replace=1 or lyricsexist=0))
{
  ;lyrics="%lyrics%"
  ;file:=CMDret_RunReturn("Tag.exe " input "-t Lyrics=" lyrics)
  FileDelete,%output%
  FileAppend,%lyrics%,%output%
}
Return


; ******************************************************************
; CMDret-AHK functions
; version 1.08 beta
;
; Updated: March 31, 2006
; by: corrupt
; Code modifications and/or contributions made by:
; Laszlo, shimanov, toralf 
; ******************************************************************
; Usage:
; CMDin - command to execute
; ******************************************************************
; Known Issues:
; - If using dir be sure to specify a path (example: cmd /c dir c:\)
; - Running 16 bit console applications may not produce output. Use
; a 32 bit application to start the 16 bit process to receive output 
; ******************************************************************
; Additional requirements:
; - none
; ******************************************************************
; Code Start
; ******************************************************************

CMDret_RunReturn(CMDin)
{
  Global cmdretPID
  idltm := A_TickCount + 20
  CMsize = 1
  VarSetCapacity(CMDout, 1, 32)
  VarSetCapacity(sui,68, 0)
  VarSetCapacity(pi, 16, 0)
  VarSetCapacity(pa, 12, 0)
  Loop, 4 {
    DllCall("RtlFillMemory", UInt,&pa+A_Index-1, UInt,1, UChar,12 >> 8*A_Index-8)
    DllCall("RtlFillMemory", UInt,&pa+8+A_Index-1, UInt,1, UChar,1 >> 8*A_Index-8)
  }
  IF (DllCall("CreatePipe", "UInt*",hRead, "UInt*",hWrite, "UInt",&pa, "Int",0) <> 0) {
    Loop, 4
      DllCall("RtlFillMemory", UInt,&sui+A_Index-1, UInt,1, UChar,68 >> 8*A_Index-8)
    DllCall("GetStartupInfo", "UInt", &sui)
    Loop, 4 {
      DllCall("RtlFillMemory", UInt,&sui+44+A_Index-1, UInt,1, UChar,257 >> 8*A_Index-8)
      DllCall("RtlFillMemory", UInt,&sui+60+A_Index-1, UInt,1, UChar,hWrite >> 8*A_Index-8)
      DllCall("RtlFillMemory", UInt,&sui+64+A_Index-1, UInt,1, UChar,hWrite >> 8*A_Index-8)
      DllCall("RtlFillMemory", UInt,&sui+48+A_Index-1, UInt,1, UChar,0 >> 8*A_Index-8)
    }
    IF (DllCall("CreateProcess", Int,0, Str,CMDin, Int,0, Int,0, Int,1, "UInt",0, Int,0, Int,0, UInt,&sui, UInt,&pi) <> 0) {
      Loop, 4
        cmdretPID += *(&pi+8+A_Index-1) << 8*A_Index-8
      Loop {
        idltm2 := A_TickCount - idltm
        If (idltm2 < 10) {
          DllCall("Sleep", Int, 10)
          Continue
        }
        IF (DllCall("PeekNamedPipe", "uint", hRead, "uint", 0, "uint", 0, "uint", 0, "uint*", bSize, "uint", 0 ) <> 0 ) {
          Process, Exist, %cmdretPID%
          IF (ErrorLevel OR bSize > 0) {
            IF (bSize > 0) {
              VarSetCapacity(lpBuffer, bSize+1)
              IF (DllCall("ReadFile", "UInt",hRead, "Str", lpBuffer, "Int",bSize, "UInt*",bRead, "Int",0) > 0) {
                IF (bRead > 0) {
                  TRead += bRead
                  VarSetCapacity(CMcpy, (bRead+CMsize+1), 0)
                  CMcpy = a
                  DllCall("RtlMoveMemory", "UInt", &CMcpy, "UInt", &CMDout, "Int", CMsize)
                  DllCall("RtlMoveMemory", "UInt", &CMcpy+CMsize, "UInt", &lpBuffer, "Int", bRead)
                  CMsize += bRead
                  VarSetCapacity(CMDout, (CMsize + 1), 0)
                  CMDout=a   
                  DllCall("RtlMoveMemory", "UInt", &CMDout, "UInt", &CMcpy, "Int", CMsize)
                }
              }
            }
          }
          ELSE
            break
        }
        ELSE
          break
        idltm := A_TickCount
      }
    }
    cmdretPID=
    DllCall("CloseHandle", UInt, hWrite)
    DllCall("CloseHandle", UInt, hRead)
  }
  IF (StrLen(CMDout) < TRead) {
    VarSetCapacity(CMcpy, TRead, 32)
    TRead2 = %TRead%
    Loop {
      DllCall("RtlZeroMemory", "UInt", &CMcpy, Int, TRead)
      NULLptr := StrLen(CMDout)
      cpsize := Tread - NULLptr
      DllCall("RtlMoveMemory", "UInt", &CMcpy, "UInt", (&CMDout + NULLptr + 2), "Int", (cpsize - 1))
      DllCall("RtlZeroMemory", "UInt", (&CMDout + NULLptr), Int, cpsize)
      DllCall("RtlMoveMemory", "UInt", (&CMDout + NULLptr), "UInt", &CMcpy, "Int", cpsize)
      TRead2 --
      IF (StrLen(CMDout) > TRead2)
        break
    }
  }
  StringTrimLeft, CMDout, CMDout, 1
  Return, CMDout
}
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: fatjoe on May 17, 2006, 10:45 PM
not tooo familiar with AHK but I downloaded it ages ago and I used AHK2Exe version 1.0.40.06 to try convert your code from a .ahk file to exe but when i ran the finished program I got error:

error at line 8.

line text: #NOEnv
Error: this line does not contain a recognized action.

Any ideas?

Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: skrommel on May 18, 2006, 04:02 AM
 :) Just delete the line, or download the latest AutoHotkey from www.autohotkey.com (http://www.autohotkey.com).

Skrommel
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 ta
Post by: fatjoe on May 18, 2006, 05:42 AM
by command line. Do you mean. making a shorcut and addnig -AddLyrics "c:\mp3\*.mp3" rescurse to the end of the target box?

Cause i did that and tested with the song The Pussycat Dolls - Buttons (id3 tag: artist: the pussycat dolls - title: buttons) -- and it didn't seem to do anythign when i ran it. Heres the lyric on azlyrics. http://www.azlyrics.com/lyrics/pussycatdolls/buttons.html

I set the target box of the shorcut to:

"F:\My Documents\My Music\batchlyrics.exe" -AddLyrics "C:\Documents and Settings\fatjoe\Desktop\*.mp3" Recurse
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: skrommel on May 18, 2006, 11:43 AM
 :) Here's another, called DownloadLyrics, without the dependency of Tag.exe

To make it work, save the text below as DownloadLyrics.ahk, then make a shortcut to it, rightclick the shortcut and select properties, and add the text after the command line, so it looks something like this:

"C:\DownloadLyrics\DownloadLyrics.ahk" "D:\*.mp3" Recurse Overwrite

Skrommel


;DownloadLyrics.ahk
; Downloads the lyrics of MP3 files
; For more tags and info on id3, check out the two first links on http://www.id3.org/develop.html
;Skrommel @2006

#SingleInstance,Force
#NoEnv
SetBatchLines,-1

If 0=0
{
  MsgBox,0,DownloadLyrics - 1 Hour Software,DownloadLyrics - Downloads the lyrics of mp3 files from azlyrics.com`n`nCommand line: `tDownloadLyrics <path to mp3(s)> [Recurse Replace]`nExample: `t`tDownloadLyrics "C:\MP3\*.mp3" Recurse Replace`n`nRecurse=Recurse into subfolders`nReplace=Replace exsting lyrics`n`nFor more tools and information, visit www.1hoursoftware.com
  ExitApp
}

path=%1%
recurse=0
If (2="recurse" Or 3="recurse")
  recurse=1
replace=0
If (2="replace" Or 3="replace")
  replace=1

Loop,%path%,0,%recurse%
{
  TrayTip,DownloadLyrics,%A_LoopFileLongPath%
  SplitPath,A_LoopFileLongPath,name,dir,ext,name_no_ext,drive
file=%A_LoopFileLongPath%
  output=%dir%\%name_no_ext%.txt
  title=
  performer=
  lyrics=
  Gosub,READTAGS
  Gosub,RETRIEVE
}
ExitApp


RETRIEVE:
If title=
  Return
If performer=
  Return
StringReplace,performer,performer,%A_Space%,+
Loop
{
  StringGetPos,start,performer,++
  If start<0
    Break
  StringReplace,performer,performer,++,+,All
}

StringReplace,title,title,%A_Space%,+,All
Loop
{
  StringGetPos,start,title,++
  If start<0
    Break
  StringReplace,title,title,++,+,All
}

lyricsexist=1
If lyrics<>
  lyricsexist=0

file=http://search.azlyrics.com/cgi-bin/azseek.cgi?q=%performer%+%title%

UrlDownloadToFile,%file%,file.htm
FileRead,file,file.htm
StringGetPos,start,file,<b>1.</b>
If start=0
  Return
StringGetPos,start,file,<a href=",,% start
start+=10
StringGetPos,stop,file,",,% start
StringMid,file,file,% start,% stop-start+1
TrayTip,DownloadLyrics,%file%

UrlDownloadToFile,%file%,file.htm
FileRead,file,file.htm
StringGetPos,start,file,"</b>
start+=9
StringGetPos,stop,file,`n<BR><BR>,,% start
StringMid,file,file,% start,% stop-start-2

tag=0
lyrics=
Loop,Parse,file
{
  If A_LoopField=<
  {
    tag=1
    Continue
  }
  If A_LoopField=>
  {
    tag=0
    Continue
  }
  If tag=0
    lyrics:=lyrics A_LoopField
}
If (lyrics<>"" And (replace=1 or lyricsexist=0))
{
  FileDelete,%output%
  FileAppend,%lyrics%,%output%
}
Return


READTAGS:
;;;;;;; HEADER ;;;;;;;
res:=BinRead(file,data,3,0)
fileidentifier:=DeHexify(data)

res:=BinRead(file,data,1,3)
majorversion:=data+0
res:=BinRead(file,data,1,4)
revisionnumber:=data+0
version=%majorversion%.%revisionnumber%

res:=BinRead(file,data,1,5)
flags=0x%data%
Transform,unsync,BitAnd,%flags%,256
Transform,extheader,BitAnd,%flags%,128
Transform,experimentalid,BitAnd,%flags%,64
Transform,footer,BitAnd,%flags%,32

res:=BinRead(file,data,2,8)
size=0x%data%
size+=0

extheaderpos:=10

;;;;;;; EXTENDEDHEADER ;;;;;;;

If extendedheader=1
{
  res:=BinRead(file,data,4,extheaderpos)
  frameid:=DeHexify(data)
 
  res:=BinRead(file,data,4,extheaderpos+4)
  extheadersize=0x%data%
  extheadersize+=10
  frameheaderpos:=extheaderpos+extheadersize
}
Else
  frameheaderpos:=extheaderpos

;;;;;;; FRAMES ;;;;;;;

Loop
{
;;;;;;; FRAMEHEADER ;;;;;;;
 
  res:=BinRead(file,data,4,frameheaderpos)
  frameid:=DeHexify(data)
 
  res:=BinRead(file,data,4,frameheaderpos+4)
  framesize=0x%data%
  framesize+=0
 
  res:=BinRead(file,data,1,frameheaderpos+8)
  flaga:=data
  res:=BinRead(file,data,1,frameheaderpos+9)
  flagb:=data
 
  If frameid=
    Break

;  TIT2: title
;  USLT: lyrics
;  TPE1: performer

  If (frameid="TPE1" Or frameid="TIT2" Or frameid="USLT")
  {
 
    framepos:=frameheaderpos+10 ;frameheadersize=10
   
;;;;;;; FRAME ;;;;;;;
   
    If framesize>0
    {
      res:=BinRead(file,data,framesize,framepos)
      frametext:=DeHexify(data)
     
      If (frameid="TPE1")
        performer:=frametext
      Else
      If (frameid="TIT2")
        title:=frametext
      Else
      If (frameid="USLT")
        StringTrimLeft,lyrics,frametext,3
    }
  }
  frameheaderpos:=frameheaderpos+framesize+10 ;frameheadersize=10
  If (frameheaderpos>=size)
    Break
}
;MsgBox,0,id3v2,Performer:%performer% `nTitle:%title% `nLyrics:`n%lyrics%
Return

DeHexify(x)
{
   StringLen,len,x
   len:=len/2
   string=
   Loop,%len%
   {
      StringLeft,hex,x,2
      hex=0x%hex%
      Transform,y,Chr,%hex%
      string:=string y
      StringTrimLeft,x,x,2
   }
   Return,string
}


;By lazlo at http://www.autohotkey.com/forum/viewtopic.php?t=4546
/* ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BinWrite ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|  - Open binary file
|  - (Over)Write n bytes (n = 0: all)
|  - From offset (offset < 0: counted from end)
|  - Close file
|  data -> file[offset + 0..n-1], rest of file unchanged
|  Return #bytes actually written
*/ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

BinWrite(file, data, n=0, offset=0)
{
   ; Open file for WRITE (0x40..), OPEN_ALWAYS (4): creates only if it does not exists
   h := DllCall("CreateFile","str",file,"Uint",0x40000000,"Uint",0,"UInt",0,"UInt",4,"Uint",0,"UInt",0)
   IfEqual h,-1, SetEnv, ErrorLevel, -1
   IfNotEqual ErrorLevel,0,Return,0 ; couldn't create the file

   m = 0                            ; seek to offset
   IfLess offset,0, SetEnv,m,2
   r := DllCall("SetFilePointerEx","Uint",h,"Int64",offset,"UInt *",p,"Int",m)
   IfEqual r,0, SetEnv, ErrorLevel, -3
   IfNotEqual ErrorLevel,0, {
      t = %ErrorLevel%              ; save ErrorLevel to be returned
      DllCall("CloseHandle", "Uint", h)
      ErrorLevel = %t%              ; return seek error
      Return 0
   }

   TotalWritten = 0
   m := Ceil(StrLen(data)/2)
   If (n <= 0 or n > m)
       n := m
   Loop %n%
   {
      StringLeft c, data, 2         ; extract next byte
      StringTrimLeft data, data, 2  ; remove  used byte
      c = 0x%c%                     ; make it number
      result := DllCall("WriteFile","UInt",h,"UChar *",c,"UInt",1,"UInt *",Written,"UInt",0)
      TotalWritten += Written       ; count written
      if (!result or Written < 1 or ErrorLevel)
         break
   }

   IfNotEqual ErrorLevel,0, SetEnv,t,%ErrorLevel%

   h := DllCall("CloseHandle", "Uint", h)
   IfEqual h,-1, SetEnv, ErrorLevel, -2
   IfNotEqual t,,SetEnv, ErrorLevel, %t%

   Return TotalWritten
}

/* ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BinRead ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|  - Open binary file
|  - Read n bytes (n = 0: all)
|  - From offset (offset < 0: counted from end)
|  - Close file
|  data (replaced) <- file[offset + 0..n-1]
|  Return #bytes actually read
*/ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

BinRead(file, ByRef data, n=0, offset=0)
{
   h := DllCall("CreateFile","Str",file,"Uint",0x80000000,"Uint",3,"UInt",0,"UInt",3,"Uint",0,"UInt",0)
   IfEqual h,-1, SetEnv, ErrorLevel, -1
   IfNotEqual ErrorLevel,0,Return,0 ; couldn't open the file

   m = 0                            ; seek to offset
   IfLess offset,0, SetEnv,m,2
   r := DllCall("SetFilePointerEx","Uint",h,"Int64",offset,"UInt *",p,"Int",m)
   IfEqual r,0, SetEnv, ErrorLevel, -3
   IfNotEqual ErrorLevel,0, {
      t = %ErrorLevel%              ; save ErrorLevel to be returned
      DllCall("CloseHandle", "Uint", h)
      ErrorLevel = %t%              ; return seek error
      Return 0
   }

   TotalRead = 0
   data =
   IfEqual n,0, SetEnv n,0xffffffff ; almost infinite

   format = %A_FormatInteger%       ; save original integer format
   SetFormat Integer, Hex           ; for converting bytes to hex

   Loop %n%
   {
      result := DllCall("ReadFile","UInt",h,"UChar *",c,"UInt",1,"UInt *",Read,"UInt",0)
      if (!result or Read < 1 or ErrorLevel)
         break
      TotalRead += Read             ; count read
      c += 0                        ; convert to hex
      StringTrimLeft c, c, 2        ; remove 0x
      c = 0%c%                      ; pad left with 0
      StringRight c, c, 2           ; always 2 digits
      data = %data%%c%              ; append 2 hex digits
   }

   IfNotEqual ErrorLevel,0, SetEnv,t,%ErrorLevel%

   h := DllCall("CloseHandle", "Uint", h)
   IfEqual h,-1, SetEnv, ErrorLevel, -2
   IfNotEqual t,,SetEnv, ErrorLevel, %t%

   SetFormat Integer, %format%      ; restore original format
   Totalread += 0                   ; convert to original format
   Return TotalRead
}
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 ta
Post by: fatjoe on May 18, 2006, 04:03 PM
I think you're onto it. I ran it again.

"F:\My Documents\My Music\batchlyrics.exe" "C:\*.mp3" Overwrite

It popped up with Download Lyrics in the tray and  the pussycat dolls - buttons. Then the link to the lyric page came after that. Then it went away. I checked the song but no lyrics were added though :(

Oh but I noticed the lyrics were downloaded to a file called file.htm in the folder that the EXE file was in.  :tellme:
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: skrommel on May 18, 2006, 05:19 PM
 :tellme: I made DownloadLyrics create a text file with the same name as the MP3, as Tag.exe wouldn't work. I'm lookin into writing the lyrics to the MP3 file.

I could automate some of the freeware programs out there, but TagRunner looks like it'll do all the job.

Skrommel
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: fatjoe on May 18, 2006, 11:51 PM
had some problems with tagrunner. Like it'd download lyrics to text file for a song and then it wouldn't apply them. Really weird.
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: skywalka on May 25, 2006, 03:33 PM
I've used the 30 day trial of the WinAmp plugin http://www.winlyrics.com.  It worked really well.

Maybe you could drag your mp3 folder to WinAmp & leave it overnight & while you are out with the volume down.
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: fatjoe on May 26, 2006, 05:21 PM
Looks ok but I have about 3000 songs I want to find lyrics for and it's not really feasible to leave the computer going all night every night for the next few weeks+ to find lyrics for them all :(
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: skrommel on May 26, 2006, 05:25 PM
 :tellme: Should I automate some of the freeware programs out there?

Skrommel
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: fatjoe on May 26, 2006, 11:45 PM
Would be good. Just a program that will get lyrics for a whole folder of music I specify (with recursive option). Tag runner was great in theory. But after a tagging run of around 1500 songs. It failed to apply lyrics to 550 songs. Heaps of these songs, it would find the lyrics, even download the text file, but not apply them.

so yeah it'd be nice if you could holla with a better program
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: Cosiness on November 25, 2009, 03:11 AM
mp3 tag can download lyrics as well. Here is an acticle on how to download lyrics for songs (http://mymusictools.com/articles/how-to-download-lyrics-for-songs.htm)
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: SleepingWolf on December 19, 2009, 05:40 PM
I love the idea, Mario fatjoe but I think that delays should be added in to allow other users to use the lyrics site rather than one user hogging their resources.
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: Shades on December 19, 2009, 06:12 PM
Songbird is a nice player but it stores lyrics in a database instead of the MP3 files. I would like to have a solution that puts the lyrics found by Songbird also in the corresponding file. Currently there is no option to do so (at least I didn't find it yet).

What if you could skip songs automatically after say 10 seconds and with a fast internet connection a collection of 3000 songs should be filled with lyrics in (3000*10)/3600 = 8 hours and 20 minutes.
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: Innuendo on December 19, 2009, 08:10 PM
Songbird is a nice player but it stores lyrics in a database instead of the MP3 files. I would like to have a solution that puts the lyrics found by Songbird also in the corresponding file. Currently there is no option to do so (at least I didn't find it yet).

The option is to start using foobar2000.  ;D   There's no batch method to do it, however.
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: scottystreet on December 21, 2009, 12:07 PM
Just use iLyrics. It's on Google code and the address is http://code.google.com/p/ilyrics/ (http://code.google.com/p/ilyrics/).

I think this has been answered fully now, so could an admin please move this to finished.
Title: Re: IDEA: Batch download lyrics for your mp3 songs in your library to the ID3 tag
Post by: skwire on December 22, 2009, 07:48 AM
Just use iLyrics. It's on Google code and the address is http://code.google.com/p/ilyrics/ (http://code.google.com/p/ilyrics/).
I think this has been answered fully now, so could an admin please move this to finished.

I beg to differ.  Your suggestion appears to be a plugin for iTunes and not everybody uses iTunes.  Since there doesn't appear to be a working solution, I may develop a stand-alone application that leverages the lyrics code from Trout.