ok, here we go. i think this is better:
1. @url is now an automatic real variable if the script has a mirror URL identified. if NO mirror is used, then this is filled with home= so that @url can be used in any script.
2. %MIRROR% will still have a pure string replacement in the script code (but I will probably leave this undocumented, and if so, then remove it later).
3. when using a mirror, home= is removed and uses the correct mirror URL
4. mirror URL index is now stored into the script pack settings file, for example: bcs.default.ini
5. the GUI menu to toggle the 'mirrors' is renamed to read 'Use URL -> LIST'
[script]
name=PirateBay.se
source=PirateBay.se
author=chip
modified=Bovski(ASC) 2011/05/29
enabled=1
version=2
cookie=tpb=1;
[mirrors]
1=http://thepiratebay.se
2=https://tpb.pirateparty.org.uk
[profiles]
all=%MIRROR%/search/%SEARCH%/0/99/0
audio=%MIRROR%/search/%SEARCH%/0/99/100
video=%MIRROR%/search/%SEARCH%/0/99/200
apps=%MIRROR%/search/%SEARCH%/0/99/300
games=%MIRROR%/search/%SEARCH%/0/99/400
[code1]
x=findh(x,@data,`searchResult`,`</tr`,`>`,)
z=find(x,@data,`</table>`)
@data=crop(@data,x,z)
@data=vacuum(@data)
@data=replace(@data,`</TD>`,`<!--EOL--></TD>`)
@data=replace(@data,` TiB`,` TB<!--EOS-->`)
@data=replace(@data,` GiB`,` GB<!--EOS-->`)
@data=replace(@data,` MiB`,` MB<!--EOS-->`)
@data=replace(@data,` KiB`,` KB<!--EOS-->`)
@r=split(@data,`</tr>`)
start
@q=split(@r,`</td>`,2)
t=array(@q,1)
$page=extract(@i,t,`href="`,`"`,@url)
$name=extract(@i,t,`title="details for`,`"`)
$torrent=extract(@i,t,`href="`,`"`,@url)
k=find(1,$torrent,`magnet:?`)
if (k>0) then
$torrent=mid($torrent,k)
end if
@i=find(@i,t,`"detDesc">Uploaded`)
$size=extract(@i,t,`Size `,`<!--EOS-->`)
$seeds=array(@q,2)
$leeches=array(@q,3)
aloop
[/code1]