2011/08/03

Xun6的下載之路

取得驗證圖片?
<img class="captcha_image" id="dynimg" src="http://www.xun6.com/captcha.php?rand=71&key=c5faf7340d3abb0" alt="驗證碼有誤" title="點擊圖片可以刷新驗證碼" onclick="document.getElementById('dynimg').src='http://www.xun6.com/captcha.php?rand='+Math.round((Math.random()*98)+1)+'&key=c5faf7340d3abb0';" />
後面有個key=c5faf7340d3abb0,看起來很恐怖齁?
<form id="verify_form" name="myform" action="http://www.xun6.net/file/a7e2371d2/MSGhost+Pro+V135.1.rar.html" method="post" onsubmit="popunder();">
<input name="captchakey" type="hidden" value="c5faf7340d3abb0" />
怎麼送出得到下載頁面?
<a href="#" class="submit_button" title="確認驗證碼與密碼正確後才點擊提交!如果不通過驗證,你需要重新輸入!" tabindex="4" onclick="dl_verify();" ><img src="http://www.xun6.com/skin/beta/images/dl/yes.gif" /> 提交驗證</a>
dl_verify();?這是尛?
<script type="text/javascript">
function dl_verify() {

popunder();
document.getElementById("verify_form").submit();
}
function popunder() {
popwindow1a=window.open("http://www.xun6.net/popunder_tw1.php", "popunder1a", "width=1000, height=600, top=0, left=0, status=yes, toolbar=yes, menubar=yes, location=yes, scrollbars=yes");
window.focus();
}
</script>
先來看一段從原始碼裡面擷取的Code吧!
<script type="text/javascript">
var timeout="12";

var protocol = "http";
var domain = "s002bg.xun6.com";
var dirname = "/file/downloads/A7E2371D2/504cb129937a";
var basename = "MSGhost+Pro+V135.1.rar";

var $countdown = "12";
var $nextrandom = "6";

function start_dl() {
popwindow1b=window.open("http://www.xun6.net/popunder_tw1.php", "popunder1b", "width=1000, height=600, top=0, left=0, status=yes, toolbar=yes, menubar=yes, location=yes, scrollbars=yes");
window.focus();

window.location = protocol+"://"+domain+dirname+"/"+basename;
}


function countdown()
{
if (timeout<=0)
{
document.getElementById("readylink").style.display="none";
document.getElementById("downloadlink").style.display="block";
}
if (timeout>0)
{
$countdown -= 1;
document.getElementById("readylink").innerHTML='正在從資料倉取得文件 請稍等<b>'+timeout+'</b>秒後下載地址就會出現';
setTimeout("countdown()",1000);
}
timeout--;
}
countdown();


function download() {
if(timeout>0) {
alert('請稍等,服務器正在取得相關資源!');
}
}
</script>

是不是很明瞭了?
timeout變數儲存的是等待的秒數,
"http://"+domain+dirname+"/"+basename
則是下載位址。

你還在看嗎?使用你喜歡的語言開發一個屬於你的Xun6下載器吧!