Bit Che > Scripts & Development
Trying to write v2 script for BakaBT
CuF:
Really slick. Is that a fully working script for BakaBT or just an example?
I had everything else written except the $torrent.
Off my own topic, but I'm having trouble with HDBits now. I know accounts for that are pretty rare, but I can't get the v1 login method to work, and special fails as well. I'm not sure what I'm doing wrong.
Edit: No, looks like that script won't properly handle the 'Alternative versions'.
Stealing your [code2] though.
Edit2: Seriously, what the heck. Now my BakaBT login isn't working again.
Edit3: Now logon is working but script is broken. Some others that worked now produce incomplete results.
Was there a code update?
CuF:
Okay, some of that is sorted. For some reason my client kept resetting back to 'Audio' searches.
Here is my BakaBT script. I'll post it on the regular script thread later... I have several more coming.
--- Code: ---[script]
name=BakaBT.me
source=BakaBT
author=CuF, Bovski
modified=2013/01/11 by CuF
version=2
pwd=1
[home]
1=http://bakabt.me
[profiles]
all=/browse.php?only=0&hentai=1&incomplete=1&lossless=1&hd=1&multiaudio=1&bonus=1&reorder=1&q=%SEARCH%
video=/browse.php?only=0&hentai=1&incomplete=1&lossless=1&hd=1&multiaudio=1&bonus=1&c1=1&c2=1&c5=1&c6=1&c8=1&reorder=1&q=%SEARCH%
audio=/browse.php?only=0&hentai=1&incomplete=1&lossless=1&hd=1&multiaudio=1&bonus=1&c3=1&reorder=1&q=%SEARCH%
[login]
login=http://bakabt.me/login.php
form=username=%USER%&password=%PASS%&returnto=/search.php
failed=<form method="post" action="login.php">
failed2=/login.php?return
[code1]
x=findh(x,@data,`<tbody>`)
z=findh(x,@data,`</tbody>`)
@data=crop(@data,x,z)
@data=vacuum(@data)
@data=replace(@data,`<span class="highlight">`,``)
@data=replace(@data,`</span>`,``)
@data=replace(@data,`<tr class="torrent_alt alt0">`,`</td>`)
@data=replace(@data,`<tr class="torrent_alt alt1">`,`</td>`)
@r=split(@data,`</tr>`)
start
@q=split(@r,`</td>`)
t=array(@q,0)
@i=find(@i,t,`Alternative versions:`)
if (@i!0) then
loop
end if
t=array(@q,1)
@i=find(@i,t,`Alternative versions:`)
if (@i!0) then
loop
end if
@i=find(@i,t,`href`)
$page=extract(@i,t,`"`,`"`,`http://www.bakabt.me`)
$name=extract(@i,t,`>`,`<`)
$date=array(@q,3)
$size=array(@q,4)
t=array(@q,5)
@i=find(@i,t,`href`)
$seeds=extract(@i,t,`>`,`<`)
@i=find(@i,t,`href`)
$leeches=extract(@i,t,`>`,`<`)
$torrent=code($page,2)
aloop
[/code1]
[code2]
x=find(@i,@data,`download_link`,`href=`)
$torrent=extract(x,@data,`"`,`"`,@home)
[/code2]
--- End code ---
Bovski:
Well the script I Posted is working well sort of.
CuF:
Yes, your script does work.
I just had noticed the weird formatting for the 'alternative versions' and spent some time faffing about to get those to come up too.
It's a weird thing. They'll only have one listing for any item, and all other encodings are just footnotes.
chip!:
--- Quote from: CuF on January 12, 2013, 02:57:05 am ---Yes, your script does work.
I just had noticed the weird formatting for the 'alternative versions' and spent some time faffing about to get those to come up too.
It's a weird thing. They'll only have one listing for any item, and all other encodings are just footnotes.
--- End quote ---
i just fixed a really weird cookies bug that I found while testing this.. it was logining and searching, but then the cookies would get messed up while trying to download because there was a "|" character in the cookie which broke how Bit Che stored and parsed parameters from one function to another (major pain, but i just re-wrote everything to completely avoid that).
Navigation
[0] Message Index
[*] Previous page
Go to full version