Lololyrics Script

Hi all,

I am trying to create a Lololyrics script to grab cover art, year and lyrics for my songs from their API
http://api.lololyrics.com/
Example here: http://api.lololyrics.com/0.5/getLyric?art...mp;track=sparta

So far this is what I've done

#By EvanK
[Name]=Lololyrics
[BasedOn]=http://www.lololyrics.com/
[AlbumUrl]=http://api.lololyrics.com/0.5/getLyric?%s
[WordSeperator]=+
[SearchBy]=artist=%artist%&track=%title%

[ParserScriptAlbum]=...
# ###################################################################
#        A  L  B  U  M
# ###################################################################

# UNSYNCEDLYRICS
outputto "UNSYNCEDLYRICS"
findline "<result><status>OK</status><response>"
movechar 37
joinuntil "</response>"
sayuntil "</response>"

# Year
outputto "YEAR"
findinline "<year>"
joinuntil "</year>"
sayuntil "</year>"

#cover
outputto "coverurl"
findinline "<cover>"
joinuntil "</cover>"
sayuntil "</cover>"

However, the lyrics have no new lines, and where ever there was a new line, it has been removed.
such as this

eng||Spartans, prepare for glory!Awu, awu, awu! [2x]A new age has begun, an age of freedomAnd all will know, that 300 Spartans gave their last breath to defend itSpartans never retreatSpartans never surrenderThis is Sparta! [2x]No retreat, no surrenderThat is Spartan lawAnd by Spartan law we will stand and fight and dieA new age has begun, an age of freedomAnd all will know, that 300 Spartans gave their last breath to defend itAwu, awu, awu! [2x]This battle is over when I say it is overSpartans never retreatSpartans never surrenderThis is Sparta!Spartans, prepare for glory!No retreat, no surrenderThat is Spartan law

Does anyone know how to fix this?

Cheers,
Evan.

I did a quick test with ...
http://api.lololyrics.com/0.5/getLyric?art...e&track=you

... and got the result ...

  <?xml version="1.0" encoding="UTF-8" ?> 
- <result>
  <status>OK</status> 
  <response>You and I We can fly into the open sky And we'll hold on while our dreams collide And take a moment in the open sky We'll take a moment in the open sky (3X) Welcome! You and I We can fly into the open sky And we'll hold on while our dreams collide And take a moment in the open sky We'll take a moment in the open sky (2X) We'll take a moment in the open sky! Welcome! You and I We can fly into the open sky And we'll hold on while our dreams collide And take a moment in the open sky We'll take a moment in the open sky</response> 
  <year>2011</year> 
  <album>Hardcore Heaven: Summer Madness [NEWCD9103]</album> 
- <sources>
  <merged /> 
  <source /> 
  </sources>
  <cover>http://www.lololyrics.com/img/cover/17003-150.jpeg</cover> 
  <url>http://www.lololyrics.com/lyrics/17003.html</url> 
  <views>4130</views> 
  </result>

It looks like as if they do not response text with newlines.
Have you checked whether there is an option for new lines in the API?

DD.20140628.1915.CEST

QUOTE (DetlevD @ Jun 29 2014, 03:15) <{POST_SNAPBACK}>
I did a quick test with ...

http://api.lololyrics.com/0.5/getLyric?art...e&track=you

... and got the result ...

  <?xml version="1.0" encoding="UTF-8" ?> 
- <result>
  <status>OK</status> 
  <response>You and I We can fly into the open sky And we'll hold on while our dreams collide And take a moment in the open sky We'll take a moment in the open sky (3X) Welcome! You and I We can fly into the open sky And we'll hold on while our dreams collide And take a moment in the open sky We'll take a moment in the open sky (2X) We'll take a moment in the open sky! Welcome! You and I We can fly into the open sky And we'll hold on while our dreams collide And take a moment in the open sky We'll take a moment in the open sky</response> 
  <year>2011</year> 
  <album>Hardcore Heaven: Summer Madness [NEWCD9103]</album> 
- <sources>
  <merged /> 
  <source /> 
  </sources>
  <cover>http://www.lololyrics.com/img/cover/17003-150.jpeg</cover> 
  <url>http://www.lololyrics.com/lyrics/17003.html</url> 
  <views>4130</views> 
  </result>

It looks like as if they do not response text with newlines.
Have you checked whether there is an option for new lines in the API?

DD.20140628.1915.CEST

Well when I checked the source of the page, it had new lines where required. How would I do it from there?

If you use the API and get text without breaks, then you can see that all new lyrics ltext lines start with an uppercased letter.
You can use this phenomenon to insert a CR-LF-sequence before each uppercase character.
For example ...
$regexp(%UNSYNCEDLYRICS%,'\s(\u)','\r\n$1')

If you are in the "websource script domain" then you have to write the regular expression in "websource spelling".

DD.20140628.2116.CEST

That would work, however, the word Spartans is in capitals breaking the sequence.
Do you have any other ideas? How can I get the text with breaks?
I don't understand because if you inspect element and view the lyrics they all have new lines.
also if you go to here (chrome only) view-source:http://api.lololyrics.com/0.5/getLyric?artist=activator&track=sparta that also has new lines

I have used another tool for standard HTTP data download, and the XML data contains a newline characters, so they deliver formatted text.
I do not know why you receive text without line breaks.
I am not familiar with the Mp3tag websource section, maybe some other person can help further on.

DD.20140629.0655.CEST

Use this code:

# UNSYNCEDLYRICS
outputto "UNSYNCEDLYRICS"
findline "<result><status>OK</status><response>"
movechar 37
sayuntilML "</response>"
QUOTE (dano @ Jun 29 2014, 17:37) <{POST_SNAPBACK}>
Use this code:
# UNSYNCEDLYRICS
outputto "UNSYNCEDLYRICS"
findline "<result><status>OK</status><response>"
movechar 37
sayuntilML "</response>"<!--QuoteEnd--></div><!--QuoteEEnd-->

Awesome! Cheers man.

One last thing. In-case the dev of lololyrics doesn't get back to me about my genre request,
How would I pull out the Genre from the website? The api contains a link to the page, and I understand how to parse it once it's on the page, but I don't understand how to get the script to then go from the api page to the search page, I don't understand the other scripts.

Thanks,
Evan.

The script is working fine, but I got a problem.

How do you run it on multiple songs?!?

You cannot run it on multiple songs.

For the extra genre page, you would have to save the genre url to a tag field with the first script and then run a second script to get the genre.