# Lololyrics Script

**URL:** https://community.mp3tag.de/t/lololyrics-script/15855
**Category:** Web Sources Discussion
**Created:** [June 28, 2014, 12:42pm UTC](https://community.mp3tag.de/t/lololyrics-script/15855 "2014-06-28T12:42:52Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Evan950](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/e495f1/32.png) [@Evan950](https://community.mp3tag.de/u/Evan950)
#### Post date: [June 28, 2014, 12:42pm UTC](https://community.mp3tag.de/t/lololyrics-script/15855/1 "2014-06-28T12:42:52Z")

</div>

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/](http://api.lololyrics.com/)  
Example here: [http://api.lololyrics.com/0.5/getLyric?art...mp;track=sparta](http://api.lololyrics.com/0.5/getLyric?artist=activator&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.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [June 28, 2014, 3:15pm UTC](https://community.mp3tag.de/t/lololyrics-script/15855/2 "2014-06-28T15:15:03Z")

</div>

> [@Evan950](#):
>
> ... the lyrics have no new lines ...

I did a quick test with ...  
[http://api.lololyrics.com/0.5/getLyric?art...e&track=you](http://api.lololyrics.com/0.5/getLyric?artist=me&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

---

<div class="post-metadata">

### Author: ![Evan950](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/e495f1/32.png) [@Evan950](https://community.mp3tag.de/u/Evan950)
#### Post date: [June 28, 2014, 4:08pm UTC](https://community.mp3tag.de/t/lololyrics-script/15855/3 "2014-06-28T16:08:33Z")

</div>

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](http://api.lololyrics.com/0.5/getLyric?artist=me&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?

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [June 28, 2014, 5:16pm UTC](https://community.mp3tag.de/t/lololyrics-script/15855/4 "2014-06-28T17:16:15Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Evan950](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/e495f1/32.png) [@Evan950](https://community.mp3tag.de/u/Evan950)
#### Post date: [June 28, 2014, 10:30pm UTC](https://community.mp3tag.de/t/lololyrics-script/15855/5 "2014-06-28T22:30:16Z")

</div>

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](http://view-source:http://api.lololyrics.com/0.5/getLyric?artist=activator&track=sparta) that also has new lines

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [June 29, 2014, 2:55am UTC](https://community.mp3tag.de/t/lololyrics-script/15855/6 "2014-06-29T02:55:59Z")

</div>

> [@Evan950](#):
>
> ... 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

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [June 29, 2014, 5:37am UTC](https://community.mp3tag.de/t/lololyrics-script/15855/7 "2014-06-29T05:37:12Z")

</div>

Use this code:

```
# UNSYNCEDLYRICS
outputto "UNSYNCEDLYRICS"
findline "<result><status>OK</status><response>"
movechar 37
sayuntilML "</response>"
```

---

<div class="post-metadata">

### Author: ![Evan950](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/e495f1/32.png) [@Evan950](https://community.mp3tag.de/u/Evan950)
#### Post date: [June 29, 2014, 7:28am UTC](https://community.mp3tag.de/t/lololyrics-script/15855/8 "2014-06-29T07:28:24Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Evan950](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/e495f1/32.png) [@Evan950](https://community.mp3tag.de/u/Evan950)
#### Post date: [June 30, 2014, 1:33pm UTC](https://community.mp3tag.de/t/lololyrics-script/15855/9 "2014-06-30T13:33:47Z")

</div>

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

How do you run it on multiple songs?!?

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [July 6, 2014, 4:00pm UTC](https://community.mp3tag.de/t/lololyrics-script/15855/10 "2014-07-06T16:00:21Z")

</div>

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.
