# \[Request\] Web Source Tutorial

**URL:** https://community.mp3tag.de/t/request-web-source-tutorial/1785
**Category:** Support
**Created:** [March 15, 2005, 2:06pm UTC](https://community.mp3tag.de/t/request-web-source-tutorial/1785 "2005-03-15T14:06:26Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![hunger01](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/e480ec/32.png) [@hunger01](https://community.mp3tag.de/u/hunger01)
#### Post date: [March 15, 2005, 2:06pm UTC](https://community.mp3tag.de/t/request-web-source-tutorial/1785/1 "2005-03-15T14:06:26Z")

</div>

hi all!  
first, thanks for this great piece of software.  
got one question though:  
i tried (for several days now) to create a script for a (korean) web source on my own, using this online help: [https://docs.mp3tag.de/tag-sources](https://docs.mp3tag.de/tag-sources).  
but actually being a total newbie to scripting or even programming, i didnt come very far. so is there anyone willing to write a little tutorial for all those newbies (as i am) out there?  
that would be much appreciated! 🙂

thanks in advance!

---

<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: [March 15, 2005, 2:43pm UTC](https://community.mp3tag.de/t/request-web-source-tutorial/1785/2 "2005-03-15T14:43:34Z")

</div>

download the existing examples, enable their debug modes, look at the html pages their search  
that helped me a lot to make my own script.

---

<div class="post-metadata">

### Author: ![hunger01](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/e480ec/32.png) [@hunger01](https://community.mp3tag.de/u/hunger01)
#### Post date: [March 15, 2005, 2:56pm UTC](https://community.mp3tag.de/t/request-web-source-tutorial/1785/3 "2005-03-15T14:56:02Z")

</div>

i tried that of course, already! 🙂  
but i still have no clue, in fact, those examples confused me even more! (strange loops, and a bunch of unknown (at least for me) commands...  
actually i just need that album cover thing...  
but as said above, i'm just clueless. 🙂

---

<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: [March 15, 2005, 3:26pm UTC](https://community.mp3tag.de/t/request-web-source-tutorial/1785/4 "2005-03-15T15:26:11Z")

</div>

I hope Florian or willmcelwain can write something. ATM I dont feel capable of doing that.  
Do you have a specific question maybe?

---

<div class="post-metadata">

### Author: ![hunger01](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/e480ec/32.png) [@hunger01](https://community.mp3tag.de/u/hunger01)
#### Post date: [March 15, 2005, 4:36pm UTC](https://community.mp3tag.de/t/request-web-source-tutorial/1785/5 "2005-03-15T16:36:22Z")

</div>

hi dano, thanks for splitting my request.  
actually i dont have much yet... just the beginning:

[Name]=jukeon  
[BasedOn]=[http://music.jukeon.com/](http://music.jukeon.com/)  
[IndexUrl]=[http://search.jukeon.com/?ks=&kk=4&kw=%s](http://search.jukeon.com/?ks=&kk=4&kw=%25s)  
[AlbumUrl]=[http://music.jukeon.com/](http://music.jukeon.com/)  
[WordSeperator]=+  
[IndexFormat]=%\_url%|%album%|%type%|%label%  
[SearchBy]=%album%

to be honest, i have no idea about this [indexFormat]. The online help says:

> [@](#):
>
> Formatstring for splitting the output buffer from the first search pass into different fields. %\_url% is needed, e.g. %\_url%|%album%|%type%|%label%

but unfortunately i have no idea how this could help me...

---

<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: [March 15, 2005, 5:20pm UTC](https://community.mp3tag.de/t/request-web-source-tutorial/1785/6 "2005-03-15T17:20:50Z")

</div>

If you run the query to the website, it all depends how the site gives you its results back.  
If you have only one result, some sites redirect you to the album site. If you have multiple results, it presents you with a site that let's you choose which album info you want to see.  
That's the first thing you must find out.  
Let's assume it gives you an overview of the results. Now you need to parse the code, to get the results in Mp3tag, so you can choose what album you want to see in Mp3tag.  
Therefore you need the %\_url% and one or more description fields.  
When I look at the site I'd use  
[IndexFormat]=%artist%|%\_url%|%album%

In the [ParserScriptIndex]=... part you must fill these 3 fields with values from the html site.  
You need to get the Artist, the Url to the Album and the Album name from the html code.

After that comes the  
[ParserScriptAlbum]=... part.  
Here you parse the final album page for information like cover, tracks,...

---

<div class="post-metadata">

### Author: ![hunger01](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/e480ec/32.png) [@hunger01](https://community.mp3tag.de/u/hunger01)
#### Post date: [March 15, 2005, 7:13pm UTC](https://community.mp3tag.de/t/request-web-source-tutorial/1785/7 "2005-03-15T19:13:55Z")

</div>

hi dano,  
thanks a lot for your tips. I'm going to try it again!  
(hopefully with a bit more success...) 🙂

---

<div class="post-metadata">

### Author: ![hunger01](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/e480ec/32.png) [@hunger01](https://community.mp3tag.de/u/hunger01)
#### Post date: [March 15, 2005, 9:02pm UTC](https://community.mp3tag.de/t/request-web-source-tutorial/1785/8 "2005-03-15T21:02:37Z")

</div>

hi dano,

i tried it again, and i think im slowly beginning to understand a little bit of that concept.  
after finishing my script, i wanted to test it, but i get following error:

```
=======================================================================
=======
Mp3tag V.2.29 - 15.03.2005 - 22:53:20
--------------------------------------------------------------------------------
OS-Version: Windows XP Service Pack 2 (Build 2600)
--------------------------------------------------------------------------------
Build: Mar 7 2005 13:45:50
--------------------------------------------------------------------------------
AppPath: 1.483.374.592 Bytes frei (D:\Program Files\Mp3tag\)
DataPath: 1.671.266.304 Bytes frei (C:\Documents and Settings\yo\Application Data\Mp3tag\data\)
TempPath: 1.671.266.304 Bytes frei (C:\DOCUME~1\yo\LOCALS~1\Temp\Mp3tag V.2.29\)
FileVersion mfc42.dll: 6.2.4131.0
================================================================================

================================================================================
ERROR
--------------------------------------------------------------------------------
File: d:\dev\projects\mp3tag\mtonlineselectdlg.cpp
Line: 88
Expression:	items.GetSize () != 0
LastError:	00000000 The operation completed successfully.

--------------------------------------------------------------------------------
CATCH
--------------------------------------------------------------------------------
File: d:\dev\projects\mp3tag\mtonlineselectdlg.cpp
Line: 127
================================================================================

================================================================================
ERROR
--------------------------------------------------------------------------------
File: d:\dev\projects\mp3tag\mtonlineselectdlg.cpp
Line: 88
Expression:	items.GetSize () != 0
LastError:	00000000 The operation completed successfully.

--------------------------------------------------------------------------------
CATCH
--------------------------------------------------------------------------------
File: d:\dev\projects\mp3tag\mtonlineselectdlg.cpp
Line: 127
===============================================================================

```

and this is my code in jukeon.src:

```
[Name]=jukeon
[BasedOn]=http://music.jukeon.com
[IndexUrl]=http://search.jukeon.com/?ks=&kk=4&kw=%s
[AlbumUrl]=http://music.jukeon.com/album.nwz
[WordSeperator]=+
[IndexFormat]=%_url%|%album%|%artist%
[SearchBy]=%album%

[ParserScriptIndex]=...

# ###################################################################
# This script parses the artist's page for all releases
# by this artist.
#
# The output format is defined by IndexFormat above, which
# is used by the selection dialog
# ###################################################################

# Uncomment the following line if you want to write some debug output
debug "on" "c:\\\\debug_jukeon_index.out"

findline "http://boardr.jukeon.com"
do
  findline "http://music.jukeon.com/album.nwz"
  findinline "http://music.jukeon.com/album.nwz"
  sayuntil "">"
    say "|"
    
  findline "title=""
    findinline "title=""
    sayuntil "">"
    say "|"
    
    findline "artist"
  findline "title=""    
  findinline "title=""
    sayuntil "">"
    saynewline
while "</table></div>"

[ParserScriptAlbum]=...

# ###################################################################
# This script parses the albums page for all common information.
#
# The current output variable is set via the outputto command
# All these fields are used by the confirm online information dialog
# ###################################################################

# Uncomment the following line if you want to write some debug output
debug "on" "c:\\\\debug_jukeon_album.out"

# coverurl
outputto "coverurl"
findline "<table border=0 cellpadding=5 cellspacing=1 bgcolor="#DDD9D0">"
findinline "<img src='"
sayuntil "'"

# album
outputto "album"
findinline "title="
sayuntil ""

# artist
outputto "artist"
findline "artist_id"
findinline "title=""
sayuntil """

# year
outputto "year"
findline "¹ß¸ÅÀÏ"
findinline "<td>"
sayuntil "."

```

Do you have an idea, whats wrong about that? Should i send in a bug report?  
Anyone else who got a tip for me? 🙂

cu and thanks for reading!

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [March 16, 2005, 8:08am UTC](https://community.mp3tag.de/t/request-web-source-tutorial/1785/9 "2005-03-16T08:08:36Z")

</div>

The error is because your web source didn't output any info. I've also noticed that there is no debug file created. This is because there are several syntax errors in your web source: please always escape quotes if you use them as parameter - instead of sayuntil ""\>" use sayuntil ""\>"  
Best regards,  
~ Florian

---

<div class="post-metadata">

### Author: ![hunger01](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/e480ec/32.png) [@hunger01](https://community.mp3tag.de/u/hunger01)
#### Post date: [March 16, 2005, 8:03pm UTC](https://community.mp3tag.de/t/request-web-source-tutorial/1785/10 "2005-03-16T20:03:52Z")

</div>

hello!  
i'm doing some mini steps forward. thanks to your tips, my script stopped crashing right in the beginning.  
Could anyone with some higher skillz look over my little Do-While thing? I dont get it to repeat until . It stops right after 1 run. thanks in advance!

```
do
  findline "<td width=\"260"
  findinline "'album', "
  sayuntil ");"
  say "|"
    
  findinline "class=ser>"
  sayuntil "</a>"
  say "|"
    
  findline "<td width=\"200\""
  findinline "class=\"ser\">"
  sayuntil "</a>"
  saynewline
while "</table>"

```

and here is a snippet of the debug\_index.out:

> [@](#):
>
> * * *
> 
> Script-Line : 21  
> Command : saynewline
> 
> Output : \>15122|1Áý - Good Day And Good Bye|¸¶¾ß  
> \<
> 
> Line and position:
> 
> ```
> <td width="200" align="left" ><a href="java script:mnuSearch('artist', 11784);" class="ser">¸¶¾ß</a></td>
> ^
> 
> ```
> 
> * * *
> 
> Script-Line : 22  
> Command : while  
> Parameter 1 : \>\<
> 
> Output : \>15122|1Áý - Good Day And Good Bye|¸¶¾ß  
> \<
> 
> Line and position:
> 
> ```
> <td width="200" align="left" ><a href="java script:mnuSearch('artist', 11784);" class="ser">¸¶¾ß</a></td>
> ^
> 
> ```
> 
> * * *
> 
> Total output:  
> output["Output"]= "15122|1Áý - Good Day And Good Bye|¸¶¾ß  
> "  
> output["Error"]= ""

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [March 16, 2005, 8:19pm UTC](https://community.mp3tag.de/t/request-web-source-tutorial/1785/11 "2005-03-16T20:19:06Z")

</div>

The do...while thing is the most tricky part when building a custom web source. The while command acts like an if and therefore the text from the first parameter has to be exactly the text of the current internal cursor position.

This is not the case with your script. As you can see from the logfile, the current position is \<td width="200" align=" and not so the loop ends.

---

<div class="post-metadata">

### Author: ![hunger01](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/h/e480ec/32.png) [@hunger01](https://community.mp3tag.de/u/hunger01)
#### Post date: [March 16, 2005, 8:24pm UTC](https://community.mp3tag.de/t/request-web-source-tutorial/1785/12 "2005-03-16T20:24:54Z")

</div>

hi florian, thanks a lot for your quick reply.  
i'm not sure what to do right now, but at least i know, where to look for. 🙂  
thanks again!  
cu  
Yo.

the do-while thing works now! thanks. but one more question: my output looks ok in the debug file, but in mp3tag, after searching when the screen pops up, where i could choose the correct album, the list remains blank. The program tells me to chose my album, but the albums arent listed there. the end of my output file looks like this:

```
Total output:
 output["Output"]= "15122|1Áý - Good Day And Good Bye|¸¶¾ß
17097|GOOD BYE ù¾Ñû (Single)|Matsuura Aya
10460|GOODBYE AND GOOD LUCK (Single)|The Brilliant Green
5105|ù¾ªÎéØê¦ - time to say <b>good</b>-<b>bye</b> (Single)|L'Arc-en-Ciel
3299|Good-<b>bye</b> My Loneliness (Single)|ZARD
3266|Good-<b>bye</b> My Loneliness (Album)|ZARD
21717|Good Bye, Lenin!£¯±Â¹ÙÀÌ, ·¹´Ñ!|Yann Tiersen
"
 output["Error"]= "<OK>"

```

anyone got another hint for me? 🙂

i just noticed something strange: If i query for an album without any korean fonts, it works. Could it be, that the korean font is the problem? Is there any possibility for that to be fixed? thanx in advance best regards

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:19pm UTC](https://community.mp3tag.de/t/request-web-source-tutorial/1785/13 "2026-02-09T12:19:20Z")

</div>


