用hta实现制作的无殇 – 快书V1.1打包下载了第1/2页

    用hta实现制作的无殇 – 快书V1.1打包下载了
    <html>
    <head>
    <title>无殇 – 快书V1.1</title>
    <meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″>
    <HTA:APPLICATION ID=”QuickBook”
    ICON=”book.ico”/>
    <link rel=”Shortcut Icon” href=”book.ico”>
    <link rel=”Bookmark” href=”book.ico”>
    <style type=”text/css”>
    <!–
    BODY {
     BACKGROUND-COLOR: #d6d3cc;
     BORDER-RIGHT: #000000 0px outset;
     COLOR: #000000;
     FONT-SIZE: 9pt;
     LINE-HEIGHT: 14px;
     TEXT-DECORATION: none;
     margin-left: 0px;
     margin-top: 0px;
     margin-right: 0px;
     margin-bottom: 0px;
     border:2 #cccccc solid;
     }
    A:link {COLOR: red; TEXT-DECORATION: none;}
    A:active {COLOR: red; TEXT-DECORATION: none;}
    A:visited {COLOR: red; TEXT-DECORATION: none}
    A:hover {COLOR: red; TEXT-DECORATION: none;}
    TD {
        COLOR: #000000; FONT-SIZE: 9pt; TEXT-DECORATION: none
    }
    .bu{
        BACKGROUND-COLOR: #f7f7f7; BORDER-BOTTOM: #999999 1px solid; BORDER-LEFT: #ffffff 1px solid; BORDER-RIGHT: #999999 1px solid; BORDER-TOP: #ffffff 1px solid; COLOR: #000000; FONT-SIZE: 9pt; HEIGHT: 20px; WIDTH:60px
    }
    .tx1{font-size:12px;border:1px solid;border-color:black black #000000;color: #0000FF}
    .ta{
     border:solid 1px;border-color:#f6f6f6 #999999 #999999 #f6f6f6;background:#d6d3cc;
     margin-bottom: 2px;
    }
    a.
    –>
    </style>
    <script>
    var timeout=180;
    var myurl=”http://minhai.go1.icpcn.com/”;
    var myhome=”http://minhai.ys168.com”;
    var myasp=”http://minhai.8u3.8u.com/”
    function err(a,b,c)
    {
        if(a==1){
            if(confirm(“程序出现未知错误,请联系:minkuwu@21cn.com!\n是否从网站下载最新版本?”))
            window.open(myhome);
            window.close();
        }else if(a==2){
            alert(“下载目录失败,可能对方网站无法访问或本机网络无法连通,尝试下载新版本!”);
            clearTime();
            bar(3);
        }else if(a==3){
            alert(“找不到小说,请确认小说参数正确,如正确请尝试更新版本!”);
            bar(4);
        }else{
            if(confirm(“发生未知错误\n错误名称:”+a+”\n错误行数:”+c+”\n是否把错误发送到网上去,以便作者进行更新?”))
            window.open(myasp+”er.asp?name=”+document.title+”&er=”+a+”&c=”+c);
        }
        return true;
    }
    window.onerror=err;
    </script>
    <body oncontextmenu=’cl();return false’>
    <COMMENT id=”DownImg” style=”behavior:url(GetFile.wsc);”></COMMENT>
    <script src=”Code.js” language=”JavaScript”></script>
    <center>需要帮助请按F1 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;欢迎访问 《<a href=”http://minhai.ys168.com”>无殇主页</a>》<img src=”close.jpg” height=12 onclick=”this.parentNode.removeNode(true);”></center>
    <table width=’100%’ border=’0′ cellpadding=’0′ cellspacing=’0′ class=ta>
    <form name=”ti” onsubmit=”download();return false;”>
    <tr>
    <td width=”18%”><input type=button class=bu value=”检查更新” onclick=”getnew(document.title);”><input type=button class=bu value=”软件测试” onclick=”cheshi();”><br><input type=button class=bu style=”width:120px;” value=”报告错误或提交建议” onclick=”sender();”></td>
    <td width=”38%”>打&nbsp;&nbsp;开:<input class=tx1 type=”text” onblur=”this.value=checkpath(this.value,false);if(checkpath(this.value)!=”){newpath.value=checkpath(this.value,false);}” name=”Folder” style=”width:195″ class=”tx1″><input type=button class=bu value=”打开路径” id=opf style=”width:65″ onclick=’Folder.value=checkpath(BrowseFolder(),false);newpath.value=Folder.value’><br>另存为:<input class=tx1 type=”text” name=”newpath” style=”width:195″ class=”tx1″ onblur=”this.value=checkpath(this.value,false);if(this.value==”) this.value=Folder.value;”><input type=button class=bu value=”创建路径” style=”width:65″ onclick=’if (checkpath(newpath.value,true)!=””) alert(“创建”+newpath.value+”完成”);’></td>
    <td width=”44%”>&nbsp;下载站点:
    <select name=”book” class=tx1 onchange=”showsearch(this.value);”>
    <option value=1 selected>起点文学</option>
    <option value=2>爬爬书库</option>
    <option value=3>玄幻书殿</option>
    <option value=4>思源中文</option>
    <option value=5>79文学网</option>
    <option value=6>虚拟天空</option>
    <option value=7>梦想文学</option>
    <option value=8>翠 微 居</option>
    <option value=9>逐 浪 网</option>
    </select> 文字编码:<select name=fan class=tx1><option value=0>保持原样</optioin><option value=1>繁 转 简</optioin><option value=2>简 转 繁</optioin></select><br>
    &nbsp;HTML–>TXT<input type=checkbox onclick=”if(this.checked){huan.checked=false;wap.checked=false;}divs();” name=”txt”>
    HTML–>WAP<input type=checkbox onclick=”if(this.checked){huan.checked=false;txt.checked=false;}divs();” name=”wap”>
    文本替换器<input type=checkbox onclick=”if(this.checked){wap.checked=false;txt.checked=false;}divs();” name=”huan”></td>
    </tr>
    <tr><td colspan=2>
    <table width=’100%’ border=’0′ cellpadding=’0′ cellspacing=’0′>
    <tr>
    <td>搜索:书名:<input size=”12″ name=”word” onkeydown=”if(event.keyCode==13){sbu.click();return false;}” class=tx1> <input type=”button” name=”sbu” value=”翠微居” class=bu> <select name=”yi” class=tx1><option value=0>异步</option><option value=1>同步</option></select></td>
    <td width=30%>
    <input type=”submit” name=”Submit” class=bu value=”下 载”> <input type=”reset” id=”ass” class=bu value=”重 置” onclick=”divr();”>
    </td>
    </tr></table>
    </td>
    <td>&nbsp;下载超时:<input type=text name=”cao” onfocus=”this.select();” class=tx1 size=4 onblur=”if(isNaN(this.value))this.value=timeout;else timeout=this.value;”> <input type=button value=”获取网址参数” class=bu style=”width:80px;” onclick=”getch(document.all.book.value);”><input type=button value=”显示网站小说” class=bu style=”width:80px;” onclick=”showxiao();”></td></tr>
    <tr><td colspan=3 align=middle><font color=red>请输入小说参数:</font><span id=”urldiv1″></span><input type=text class=tx1 size=6 name=”url” onFocus=”this.select();” onblur=”var re=geturl(book.value);if(this.value.replace(re,”)!=”) this.value=”” ondblclick=”this.select();document.execCommand(‘paste’);”><span id=”urldiv2″></span></td></tr>
    </form>
    </table>
    <form name=”search” method=”post” style=”display:none;”><input type=text name=”key”></form>
    <table width=’100%’ border=’0′ cellpadding=’0′ cellspacing=’0′ class=ta id=”tihuan” style=”display:none;”>
      <tr>
      <form name=”th”>
    <td width=’5%’>&nbsp;</td>
    <td><font size=3 color=red><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;纯文本替换:</font>替换个数<input tpye=text class=”tx1″ value=1 size=3 onchange=”if(!isNaN(this.value)) setid(this.value)” onfocus=”this.select();”> 把HTML转换成TXT<input type=checkbox name=”zhuan” onclick=”if(this.checked){this.parentNode.children[1].value=0;dis(this.parentNode.children[3],1);setid(0);}else{dis(this.parentNode.children[3],0);}”><span style=”display:none;”>&nbsp;删除源文件<input type=checkbox name=”yuan”></span></td>
    <td>&nbsp;</td>
      </tr>
      <tr>
    <td>&nbsp;</td>
    <td>替换<b>1</b>:<textarea rows=7 cols=40 name=”ti1″ class=”tx1″></textarea>成<textarea rows=7 cols=40 name=”hu1″ class=”tx1″></textarea></textarea><br></td>
    <td>正则替换:<input type=checkbox name=”zenze”><br>全部替换:<input type=checkbox checked name=”tihuan”><br>忽略大小写:<input type=checkbox name=”da”></td>
      </tr>
      <tr>
    <td>&nbsp;</td>
    <td><center><input type=button onclick=’if (obj.Folder.value!=””){tihu(obj.Folder.value,obj.newpath.value);}else{alert(“请先打开欲替换的目录!”);obj.opf.click();}’ class=bu value=”替 换”><input type=reset class=bu value=”重 置”></center></td>
    <td></td>
      </tr>
      </form>
    </table>

    <div id=”show” style=”display:”;”>
    <span id=”menu”></span>
    <table align=”center” width=”40%” border=”0″ cellpadding=”0″ cellspacing=”1″ bgcolor=”#000063″ id=”jin” style=”display:none”>
    <tr>
    <td bgcolor=”#ffffff”>
    </td>
    </tr>
    <tr>
    <td bgcolor=”#ffffff” align=”center”></td>
    </tr>
    <tr>
    <td bgcolor=”#ffffff” align=”center”></td>
    </tr>
    </table>
    <br>
    <table align=center width=’70%’ border=’0′ cellpadding=’0′ cellspacing=’1′ bgcolor=#000000 style=”display:none;”>
    <tr bgcolor=#ffffff>
    <td align=center id=”loading”></td>
    <td align=center id=”downer” style=”display:none;”></td>
    </tr>
    </table>
    </div>
    <table align=center width=’50%’ border=’0′ cellpadding=’0′ cellspacing=’1′ bgcolor=#000000 id=cs style=”display:’none'”>
    <tr bgcolor=#ffffff>
    <td align=center>

    </td>
    </tr>
    </table>
    <script language=”javascript” defer>
    //初始化数据
    String.prototype.getid=function(){return document.getElementById(this);}
    var theFSO = new ActiveXObject(“Scripting.FileSystemObject”);
    var ajax=new Array(“Microsoft.XMLHTTP”,”Msxml2.XMLHTTP.6.0″,”Msxml2.XMLHTTP.5.0″,”Msxml2.XMLHTTP.4.0″,”MSXML2.XMLHTTP.3.0″,”MSXML2.XMLHTTP”);
    var xmlhttp;
    for(var i=0;i<ajax.length;i++)
    try{xmlhttp = new ActiveXObject(ajax[i]);break;}catch(e){}
    var adodbStream=new ActiveXObject(“ADODB.Stream”);
    var rs=new ActiveXObject(“ADODB.RecordSet”);
    //初始化全局变量
    var obj=document.ti,m,newurl,cl1,cl2,ll,url1,url2,thelist=””,downlist,dxing,thetime,der,there,newpic,stop=0,mdb,zhangting;
    var zhen=new Array();

    obj.book.onchange();

    document.all.cao.value=timeout;

    //开始下载
    function download()
    {
        if(document.all.url.value==””)
        {
            alert(“请输入小说参数!”);
            document.all.url.focus();
            return;
        }
        clearTime();
        dis(“show”,1);
        dis(“menu”,1);
        dis(“jin”,0);
        dis(“loading”,0);
        dis(“show”.getid().children[3],0);
        thelist=””;
        “menu”.getid().innerHTML=”<table align=center width=’50%’ border=’0′ cellpadding=’0′ cellspacing=’1′ bgcolor=#000000><tr bgcolor=#ffff00><td align=center>正在下载小说目录……<font id=’cshi’ color=RED><\/span></td></tr></table>”;
        setTimeout(“downmenu();”,10);
    }
    //下载目录
    function downmenu()
    {
        var fan=document.all.yi.value==0?true:false;
        cl1=null;cl2=null;
        if(fan)
        {
            if(“cshi”.getid()==null)return;
            “cshi”.getid().innerText=timeout;
            clearTime();
            thetime=setInterval(function()
            {
                if(“cshi”.getid()==null || xmlhttp.readyState==0){clearTime();return;}
                if(xmlhttp.readyState<4)
                {
                    if(“cshi”.getid().innerText==1)
                    {
                        clearTime();
                        bar(5);
                    }else
                    “cshi”.getid().innerText=parseInt(“cshi”.getid().innerText)-1;
                }else clearTime();
            },1000);
        }
        var str=gettxt(url1+document.all.url.value+url2,fan,function()
        {
            var thestr;
            if(xmlhttp.readyState<4)return;
            if(xmlhttp.readyState!=4){err(2);return;}
            bar(2);
            if(obj.book.value==9)
            setTimeout(function(){showmenu(gb2(xmlhttp.responseBody));},10);
            else
            setTimeout(function(){showmenu(gb(xmlhttp.responseBody));},10);
            return;
        },obj.book.value);
        if(!fan)
        {
            if(typeof(str)!=”object”){err(2);return;}
            bar(2);
            setTimeout(function(){showmenu(str[0]);},10);
        }
    }

    function bar(id,color1,color2){
        var str,color1,color2;
        if(id==2)
        {
            str=”处理小说目录中……”;
            color1=”#000000″;
            color2=”#00ff00″;
        }else{
            str=id==3?”访问小说网站失败,无法连接!”:id==4?”找不到小说!”:”网络超时,对方网站未反应”
            color1=”YELLOW”;
            color2=”#8C0000″;
        }
        “menu”.getid().firstChild.rows[0].cells[0].innerHTML=”<font color=”+color1+”>”+str+”</font>”;
        “menu”.getid().firstChild.rows[0].bgColor=color2;
    }

    //显示小说目录
    function showmenu(str)
    {
        if(str==null || str==””){err(2);return;}
        var p,re,k=0,c=0;
        var mulu=new Array(“<table align=center width=’80%’ border=’0′ cellpadding=’0′ cellspacing=’1′ class=’ta’>”);
        var list=new Array();
        newurl=””;
        m=””;
        switch(parseInt(obj.book.value))
        {
    //起点中文
        case 1:
            m=cmfu(str);
            p=m.match(/title>(.*?)\s\-\-/i);
            var j,b,s=”Object Not FoundHTTP\/1.1″,i=1,r=/Object Not FoundHTTP\/1\.1|<TITLE>无法找到该页<\/TITLE>/,bb=”6|8|2|7|5|1|3|4|9|10″.split(“|”);
            newurl=”http:\/\/newauthor6.cmfu.com\/books\/”+document.all.url.value+”\/”
            re=/<a.+?'(\d+)\.htm'[\s\S]+?>(.+?)<\/a>|<font color=black>(.+?)<\/font>/gi;
            if(p==null || p==””)
            {
                err(3)
                return;
            }
            var arr;
            mulu[mulu.length]=xiaomenu(p[1]);
            while (re.test(m))
            {
                if(RegExp.$3!=””)
                {
                    if(k==1){mulu[mulu.length]=”<td width=’25%’><\/td><\/tr>”;k=0;}
                    mulu[mulu.length]=xiaomenu1(RegExp.$3);
                    j=RegExp.$3;
                }else{
                    if(k==0) mulu[mulu.length]='<tr>’;
                    mulu[mulu.length]=xiaomenu2(c,RegExp.$1+”|”+j,RegExp.$2);
                    c++;
                    if(k==1) mulu[mulu.length]=”<\/tr>”;
                    k=(k==1)?0:1
                    if(b==null)
                    {
                        while(r.test(s) && i++<10)
                        {
                            newurl=newurl.replace(/\d/,bb[i]);
                            s=gettxt(newurl+arr+”.txt”,false);
                            if(typeof(s)==”object”)s=s[0];
                        }
                        b=i;
                    }
                }
            }
        break;
    //爬爬书库
        case 2:
            m=pap(str);
            newurl=url1+document.all.url.value+”\/”
            re = /<a\D+(\d+)\.htm[^>]+>(.+?)<\/a>|2px’>(.*?)<\/td>/gi;
            p=str.match(/<TITLE>(.*?)_目录_爬爬书库/i)
            mulu=themu(mulu,p,m,re);
        break;
    //玄幻书殿
        case 3:
            zfile=null;
            str.replace(/(http:\/\/book\.xhsd\.net\/book\/\d*\/\d*\/)page\.js/,function(a,b){newurl=b;})
            str=gettxt(newurl+”page.js”,false)
            if(typeof(str)!=”object”){err(2);return;}
            eval(str[0].replace(“var “,””))
            if(newurl==”” || newurl==null || zfile==null)
            {
                err(3);
                return;
            }
            m=xhm(zfile);
            m='<html>\r\n<head>\r\n<title>目录<\/title>\r\n<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″>\r\n<style>\r\n.box{\r\nborder-collapse: collapse\r\n}\r\nbody {margin-top: 5px;}\r\ntd {\r\n    font-size: 9pt;\r\n}\r\n\r\na{\r\n    font-size: 9pt;\r\n    color: #000066;\r\n    text-decoration: none;\r\n}\r\n\r\na:link {\r\n    font-size: 9pt;\r\n    color: #000066;\r\n    text-decoration: none;\r\n}\r\na:visited {\r\n    font-size: 9pt;\r\n    color: #000000;\r\n    text-decoration: none;\r\n}\r\na:hover {\r\n    font-size: 9pt;\r\n    color: #FF0000;\r\n    text-decoration: underline;\r\n}\r\na:active {\r\n    font-size: 9pt;\r\n    color: #000000;\r\n    text-decoration: none;\r\n}\r\n\r\n<\/style>\r\n<\/head>\r\n<center>\r\n<BODY>\r\n<table width=”760″ border=1 cellpadding=2 cellspacing=0 bordercolor=”#808080″ bgcolor=”white” class=”box”>\r\n<tr><td colspan=”4″ nowrap bgcolor=”#808080″>&nbsp;<font color=”#FFFFFF”><b>目录<\/b><\/font><\/td><\/tr>\r\n’+m+’\r\n<tr><td colspan=”4″>\r\n<\/td>\r\n<\/tr>\r\n<\/table>\r\n<\/BODY><\/center><\/html>’;
            list=list.concat(zfile)
            mulu[mulu.length]=xiaomenu(_name);
            for(var i=0;i<list.length-1;i+=2)
            {
                if(zfile[i]==”__”)
                {
                    if(k==1){mulu[mulu.length]=”<td width=’25%’><\/td><\/tr>”;k=0;}
                    mulu[mulu.length]=xiaomenu1(list[i+1]);
                }else{
                    if(k==0) mulu[mulu.length]='<tr>’;
                    mulu[mulu.length]=xiaomenu2(c,list[i],list[i+1]);
                    c++;
                    if(k==1) mulu[mulu.length]=”<\/tr>”;
                    k=(k==1)?0:1
                }
            }
        break;
    //思源中文
        case 4:
            m=shim(str);
            p=m.match(/title>([^-]+)–/i)
            newurl=url1+document.all.url.value+”\/”
            re=/<a href=”(\d+)\.htm”>(.+?)<\/a>|vcss”>[\r\n]+\s+(\S+)\s/gi;
            mulu=themu(mulu,p,m,re);
        break;
    //79文学网
        case 5:
            m=mu79(str);
            newurl=url1+document.all.url.value+”\/”
            re = /<a href=”(\d+)\.[^>]+>(.+?)<\/a>|<div id=”NclassTitle”>(.+?)<\/div>/gi;
            p=m.match(/<title>(.*?)<\/title>/i)
            mulu=themu(mulu,p,m,re);
        break;
    //虚拟天空
        case 6:
            m=xkm(str);
            p=str.match(/<title>(.+?) – .*? – 虚拟天空/)
            newurl=”http://www.xntk.com/book_j.php?tid=”+document.all.url.value.split(“\/”)[0]+”&bid=”+document.all.url.value.split(“\/”)[1]+”&cid=”;;
            re=/<a\D+(\d+)\.htm>(.*?)<\/a>|max2′>(.*?)<\/td>/gi
            mulu=themu(mulu,p,m,re);
        break;
    //梦想文学
        case 7:
            m=mx99(str);
            p=str.match(/title>(.*?)–/i)
            newurl=url1+document.all.url.value+”\/”
            re=/<a\D+(\d+)\.htm[^>]+>(.*?)<\/a>|=xt>(.*?)<\/td>/gi;
            mulu=themu(mulu,p,m,re);
        break;
    //翠微居
        case 8:
            newurl=url1+document.all.url.value+”\/”
            p=str.match(/<title>(.*?)(?:\-[^\-]+)+<\/title>/i)
            m=cwm(str)
            re=/<a\D+(\d+)\.htm”>(.+?)<\/a>|vcss”>(.+?)<\/td>/gi
            mulu=themu(mulu,p,m,re);
        break;
    //逐浪网
        case 9:
            newurl=url1+document.all.url.value+”\/”
            m=zhu(str);
            p=m.match(/<title>(.+?)\|.+?<\/title>/i)
            re=/<a href=”(\d+)[^>]+>(.+?)<\/a>|bottomborder”>(.+?)<\/li>/gi
            mulu=themu(mulu,p,m,re);
        break;
        default:err(1);return;
        }
        if(mulu==null)return;
        mulu[mulu.length]=”<\/tr><tr><td colspan=’2′ align=center><input type=button onclick=’xuan(1);’ value=’选中’ class=bu style=’width:30′> <input type=button onclick=’xuan(2);’ value=’反选’ class=bu style=’width:30′> <input type=button onclick=’chuanxuan(1);’ value=’全选’ class=bu style=’width:33′> <input type=button onclick=’chuanxuan(2)’ value=’全反选’ class=bu style=’width:43′> <input type=button class=bu onclick=\”if(obj.Folder.value==”){alert(‘请先选择目录!’);obj.opf.click();if(obj.Folder.value==”) return;}downxiao();\” value=’下载小说’ id=’ddo’ style=’width:55;color:red’>下载目录<input type=checkbox checked name=’xml’>下载图片<input type=checkbox checked name=’dp’>图片异步下载<input type=checkbox checked name=’picdown’><\/td><\/tr><\/table>”
        “menu”.getid().innerHTML=mulu.join(“”);
        return;
    }

    function themu(mulu,p,str,re)
    {
        var k=0,c=0;
        if(p==null || p==””)
        {
            err(3);
            return;
        }
        mulu[mulu.length]=xiaomenu(p[1]);
        while (re.test(str))
        {
            if(RegExp.$3!=””){
                if(k==1){mulu[mulu.length]=”<td width=’25%’><\/td><\/tr>”;k=0;}
                mulu[mulu.length]=xiaomenu1(RegExp.$3);
            }else{
                if(k==0) mulu[mulu.length]='<tr>’;
                mulu[mulu.length]=xiaomenu2(c,RegExp.$1,RegExp.$2);
                c++;
                if(k==1) mulu[mulu.length]=”<\/tr>”;
                k=(k==1)?0:1
            }
        }
        if(k==1) mulu[mulu.length]=”<td width=’25%’><\/td>”;
        return mulu;
    }

    //开始下载章节
    function downxiao(n)
    {
        if(thelist==null || thelist==””)
        {
            alert(“请至少选择一个章节!”);
            return;
        }
        clearTime();
        if(n==null)
        {
            dis(“menu”,0);
            dis(“jin”,1);
            dis(“show”.getid().children[3],1);
            dis(“loading”,1);
            dis(“downer”,0);
            “loading”.getid().innerHTML=””;
            “downer”.getid().innerHTML=””;
            der=0;
            dxing=thelist;
            stop=0;
            downlist=thelist.split(“,”);
            document.body.oncontextmenu=function(){return false;}
            n=0;
            zhangting=new Array();
            jin.rows[0].cells[0].innerHTML='<table  border=”0″ width=”0%” bgcolor=”#000063″><tr><td width=”100%” height=”15″ align=”center”><font color=”white”><b>0%<\/b><\/font><\/td><\/tr><\/table>’
            jin.rows[1].cells[0].innerHTML=’0\/’+(thelist.split(‘,’).length-1)
            jin.rows[2].cells[0].innerHTML='<input type=button name=”zhan” class=bu value=”暂停”><input type=button name=”ting” class=bu value=”停止”>’
            oldtime=new Date().getTime();
            switch(parseInt(obj.book.value))
            {
                case 4:there=/<img src=”([^”]+)”/gi;break;
                case 5:there=/<img src=”([^”]+)”/gi;break;
                case 6:there=/<img src=([^>]+)/gi;break;
                case 7:there=/<IMG.+?src=”([^”]+)”/gi;break;
                default:break;
            }
            document.all.zhan.onclick=function()
            {
                this.value=(stop===2)?”暂停”:”继续”;
                if(stop===0)
                {
                    stop=2;
                }else{
                    stop=0;
                    switch(parseInt(zhangting[0]))
                    {
                        case 0:downxiao(zhangting[1]);break;
                        case 1:downzhang(zhangting[1]);break;
                        case 2:editzhang(zhangting[1],zhangting[2],zhangting[3],zhangting[4]);break;
                        case 3:pic(zhangting[1]);break;
                        case 4:downpic(zhangting[1]);break;
                        case 5:adderr(zhangting[1],zhangting[2]);break;
                        case 6:downover(zhangting[1],zhangting[2]);break;
                        default:err(1);break;
                    }
                }
            }
        }
        if(stop!==0)
        {
            if(stop==2)zhangting=new Array(0,n);
            return;
        }
        n++
        document.all.ting.onclick=new Function(“downover(“+n+”,1);”);
        if(“loading”.getid().innerHTML.split(“<BR>”).length>=15)
        {
            “downer”.getid().innerHTML+=”loading”.getid().innerHTML;
            “loading”.getid().innerHTML=””
        }
        “loading”.getid().innerHTML+=((n==1)?””:”<br>”)+”<span id=’wang’>正在<\/span>下载 [ <font color=blue><b>”+menulist[downlist[n]].innerHTML.replace(/^<.*?>/,””)+”<\/b><\/font> ] <font id=’cheng’>……<\/font><font id=’caoshi’ color=’#E98D00′><\/font>”;
        setTimeout(“downzhang(“+n+”)”,1);
    }

    function downzhang(n)
    {
        if(stop!==0)
        {
            if(stop==2){zhangting=new Array(1,n);}
            return;
        }
        if(downlist==null)return;
        yan(downlist[n],0);
        var bo=document.all.book.value
        var p=checkpath(obj.Folder.value+document.all.xname.value+”–“+obj.book.options[obj.book.selectedIndex].text+”\\\\”,true);
        newpic=new Array();
        if (bo==9 && n==1 && !document.all.txt.checked && !document.all.wap.checked)
        {
            try{
                SaveText(gettxt(“http://www.zhulang.com/book.css”,false)[0],p+”book.css”);
            }catch(e){
                “loading”.innerHTML+=”<br>保存 [ <font color=#E98D00>风格文件<\/font> ] <font color=red>失败<\/font>!”
            }
        }
        if (n==1 && document.all.xml.checked)
        {
            try{
                SaveText(m,p+”index.htm”);
                if(bo==4)
                SaveText(gettxt(“http://book.syzw.cn/configs/article/page.css”,false)[0],p+”page.css”);
                else if(bo==7)
                SaveText(‘body\r\n{\r\nbackground-color:#E7F4FE\r\n}\r\n.zt{font-size:10.5pt;line-height:160%;font-family:”宋体”,”verdana”,”Arial”,”MS Sans Serif”;}\r\n.m{padding-left:80px;padding-right:80px;TEXT-INDENT: 2em; FONT-FAMILY: 宋体;font-size:16px;LINE-HEIGHT: 130%;}\r\nP{TEXT-INDENT: 2em;}\r\n.b{background-color:#663366;font-size:12px;color:#ffffff;}\r\n.i{font-size:10pt;}\r\nA:link {COLOR: #004D00; TEXT-DECORATION: none}\r\nA:active {COLOR: blue; TEXT-DECORATION: underline}\r\nA:visited {COLOR: #004D00; TEXT-DECORATION: underline}\r\nA:hover {COLOR: blue; TEXT-DECORATION: underline;position:relative;left:1px;top:1px}’,p+”css.css”)
                else if(bo==8)
                SaveText(‘body {\r\n\tfont-family: 宋体,新细明体,Verdana,Arial,sans-serif;\r\n\tfont-size: 14px;\r\n}\r\n\r\na {\r\n\tcolor: #0A672E;\r\n\ttext-decoration: none;\r\n}\r\n\r\na:hover {\r\n\tcolor: #666666;\r\n}\r\n\r\nhr{\r\n\theight: 1px;\r\n\twidth: 100%;\r\n\tcolor: #000000;\r\n\tpadding: 0px;\r\n\tmargin: 0px;\r\n}\r\n#title{\r\n    text-align: center;\r\n\tfont-size: 16px;\r\n\tfont-weight: bold;\r\n\tline-height: 200%;\r\n}\r\n\r\n#content{\r\n    text-align: left;\r\n\tpadding: 10px 3% 10px 3%;\r\n\tfont-size: 16px;\r\n}\r\n\r\n.acss{\r\n    width: 90%;\r\n    text-align: left;\r\n\tbackground: #CBCDCC; \r\n}\r\n\r\n.vcss{\r\n\tfont-size: 16px;\r\n    background: #E0FFD7; \r\n    text-align: center;\r\n}\r\n\r\n.ccss{\r\n    font-size: 14px;\r\n    background: #EFFEE9; \r\n    width: 25%;\r\n\ttext-align: leftr;\r\n}\r\n\r\n#footlink{\r\n\ttext-align: center;\r\n\tline-height: 200%;\r\n}\r\n\r\n#info{\r\n\ttext-align: center;\r\n\tline-height: 200%;\r\n}’,p+’page.css’)
                else if(bo==6)
                SaveText(‘A {TEXT-DECORATION: none}\r\nA:link {COLOR: #333333}\r\nA:visited {COLOR: #a650; }\r\nA:hover {COLOR: #ff6600}\r\nBODY {SCROLLBAR-FACE-COLOR: #eeeeee; FONT-SIZE: 9pt; SCROLLBAR-HIGHLIGHT-COLOR: #f0f0f0; SCROLLBAR-SHADOW-COLOR: #999999; COLOR: #000000; SCROLLBAR-3DLIGHT-COLOR: #eeeeee; SCROLLBAR-ARROW-COLOR: #000000; SCROLLBAR-TRACK-COLOR: #eeeeee; FONT-FAMILY: 宋体; SCROLLBAR-DARKSHADOW-COLOR: #eeeeee; TEXT-DECORATION: none}\r\nTD {FONT-SIZE: 9pt; COLOR: #333333; LINE-HEIGHT: 150%; FONT-FAMILY: 宋体}\r\n.min {font-family: \’宋体\’;font-size: 10pt;}\r\n.middl{font-size : 14px;line-height: 18px}\r\n.max {font-family: \’宋体\’;font-size: 12pt;font-weight: bold;}\r\n.max2 {font-family: \’宋体\’;font-size: 10pt; background-color:\’#E3E3E3\’}’,p+’2007.css’);
                else if(bo==9){
                SaveText(gettxt(“http://www.zhulang.com/css/layout.css”,false)[0],p+”layout.css”);
                SaveText(gettxt(“http://www.zhulang.com/css/mulubook.css”,false)[0],p+”mulubook.css”);
                }
            }catch(e){
                “loading”.innerHTML+=”<br>保存 [ <font color=#E98D00>小说目录<\/font> ] <font color=red>失败<\/font>!”
            }
        }
        var downurl;
        if(bo==2 || bo==3 || bo==5)
            downurl=newurl+document.all.list[downlist[n]].value+”.htm”;
        else if(/[4789]/.test(bo))
            downurl=newurl+document.all.list[downlist[n]].value+”.html”;
        else if(bo==1)
            downurl=newurl+document.all.list[downlist[n]].value.split(“|”)[0]+”.txt”;
        else if(bo==6)
            downurl=newurl+document.all.list[downlist[n]].value
        else{
            err(1);return;
        }
        if(document.all.yi.value==0)
        {
            if(“caoshi”.getid()==null)return;
            “caoshi”.getid().innerText=timeout;
            clearTime();
            thetime=setInterval(function()
            {
                if(stop===2){zhangting=new Array(7,this);clearTime();return;}
                if(stop===1 || “caoshi”.getid()==null || xmlhttp.readyState==0){clearTime();return;}
                if(xmlhttp.readyState<4)
                {
                    if(“caoshi”.getid().innerText==1)
                    {
                        clearTime();
                        downover(n,3);
                    }else
                    “caoshi”.getid().innerText=parseInt(“caoshi”.getid().innerText)-1;
                }else clearTime();
            },1000);
        }
        var str=gettxt(downurl,document.all.yi.value==0,function()
        {
            var thestr,r=xmlhttp.readyState;
            if(stop===1 || r<4)return;
            if(obj.book.value!=9)
            thestr=gb(xmlhttp.responseBody);
            else
            thestr=gb2(xmlhttp.responseBody);
            clearTime();
            if(r!=4 || thestr==null || thestr==””)
            {
                newpic=new Array();
                downover(n,2);
            }else{
                newpic=getpic(thestr,p,n);
                editzhang(thestr,n,newpic.length,p);
            }
            return;
        },obj.book.value);
        if(obj.yi.value==1)
        {
            if(typeof(str)!=”object”){downover(n,2);return;}
            newpic=getpic(str[0],p,n);
            editzhang(str[0],n,newpic.length,p);
        }
    }
    //处理章节
    function editzhang(str,n,l,path)
    {
        var name,rre;
        clearTime();
        if(stop!==0)
        {
            if(stop==2)zhangting=new Array(2,str,n,l,path);
            return;
        }
        if(obj.book.value==6)
        {
            rre=/<script src=(http:\/\/\w+.cmfu\.com\/\/?books\/\d+\/\d+\.txt)><\/script>/i
            if(str.match(rre)!=null)
            {
                ss=gettxt(RegExp.$1,false);
                if(typeof(ss)==”object”)
                str=str.replace(rre,ss[0].substring(16,ss[0].length-5))
            }
        }
        if(obj.fan.value!=0)str=convert(obj.fan.value,str);
        if(cl1==cl2 || cl2==null){cl1=null;cl2=null;}
        else if(cl1>cl2)cl1–;
        else cl1++;
        if(l!=0)str=str.replace(there,function(a,b){return “<img src='”+b.replace(/^.+\//,””)+”‘”;});
        switch(parseInt(obj.book.value))
        {
            case 1:
                str=cmf(str,document.all.list[downlist[n]],document.all.list[parseInt(downlist[n])+1],document.all.list[downlist[n]-1],downlist[n]);
                break;
            case 2:str=paf(str);break;
            case 3:str=xhf(str);break;
            case 4:str=shif(str);break;
            case 5:str=f79(str);break;
            case 6:str=xnf(str);break;
            case 7:str=mx9(str);break;
            case 8:str=cwf(str);break;
            case 9:str=zhuf(str);break;
            default:err(1);return;
        }
        if(obj.txt.checked)
        {
            str=txtf(str);
            h=”txt”;
        }else if(obj.wap.checked){
            str=wapf(str);
            h=”wml”;
        }else{
            h=”htm”
        }
        if(obj.book.value==1)
        name=path+document.all.list[downlist[n]].value.split(“|”)[0]+”.”+h;
        else
        name=path+document.all.list[downlist[n]].value+”.”+h;
        try{
            SaveText(str,name);
            document.all.list[downlist[n]].checked=false
            dxing=dxing.replace(eval(“\/,”+downlist[n]+”(,|$)\/”),”$1″)
        }catch(hh){
            “loading”.getid().innerHTML+”<br>保存 [ <font color=#E98D00>”+menulist[downlist[n]].innerHTML.replace(/^<.*?>/,””)+”<\/font> ] <font color=red>失败<\/font>!”
        }
        if(l==0){
            downover(n);
        }else{
            if(obj.yi.value==1)
            setTimeout(function(){pic(0);},10);
            else
            pic(0);
        }
    }

    //采集系统
    function gettxt(url,f,onReady,b)
    {
        xmlhttp.abort();
        try{
            if(f)
            xmlhttp.onreadystatechange = onReady;
            xmlhttp.open(“GET”,url,f);
            xmlhttp.send();
            if(f)return;
            if(xmlhttp.readyState!=4){return “f”;}
            var str=new Array()
            if(b==9)
            str[0]=gb2(xmlhttp.responseBody);
            else
            str[0]=gb(xmlhttp.responseBody);
            xmlhttp.abort();
            return str;
        }catch(e){
            return “f”;
        }
    }

    //判断是否有图片
    function getpic(str,p,n)
    {
        var bo=parseInt(obj.book.value);
        if(bo<4 || bo>7 || !document.all.dp.checked) return new Array();
        var arr,ss,re=new RegExp(there);
        while ((arr = re.exec(str)) != null)
        {
            if(bo==7)
            newpic.push(“http://www.mx99.com”+arr[1])
            else if(bo==5)
            {
            if(arr[1].replace(“front.gif”,””).length==arr[1].length)
            newpic.push(“http://www.79wx.net”+arr[1])
            }else
            newpic.push(arr[1])
        }
        if(newpic.length>0)newpic.push(p,n)
        return newpic;
    }

    //采集图片
    function pic(k)
    {
        if(stop!==0)
        {
            if(stop==2)zhangting=new Array(3,k);
            return;
        }
        if(newpic[newpic.length-1]==jin.rows[1].cells[0].innerText.match(/(\d*)?\//)[1])return;
        var downobj=”DownImg”.getid();
        if(k>newpic.length-3)
        {
            downover(newpic[newpic.length-1])
            return;
        }
        adderr(0,newpic[k].replace(/^.*\//,””));
        if(document.all.picdown.checked)
        {
            if(“caoshi”.getid()==null)return;
            “caoshi”.getid().innerText=timeout;
            clearTime();
            thetime=setInterval(function()
            {
                if(stop===2){zhangting=new Array(8,this);clearTime();return;}
                if(stop===1 || “caoshi”.getid()==null || (downobj.Ready==0 && xmlhttp.readyState==0)){clearTime();return;}
                if((xmlhttp.readyState<4 && xmlhttp.readyState!=0) || (downobj.Ready<4 && downobj.Ready!=0))
                {
                    if(“caoshi”.getid().innerText==1)
                    {
                        clearTime();
                        downobj.Abort();
                        adderr(4)
                        pic(++k);
                    }else
                    “caoshi”.getid().innerText=parseInt(“caoshi”.getid().innerText)-1;
                }else clearTime();
            },1000);
        }
        if(document.all.book.value!=6)
        {
            downpic(k);return;
        }else{
            downobj.DownImgOk = function()
            {
                if(downobj.Ready==4 && downobj.Data!=null)
                {
                    try{
                        SaveFile(downobj.Data,newpic[newpic.length-2]+newpic[k].replace(/^.*\//,””));
                    }catch(h){
                        adderr(2,h.description)
                    }
                }else
                    adderr(3);
                if(obj.yi.value==0)
                pic(++k);
                else
                setTimeout(function(){pic(++k);},10);
            }
            downobj.GetFile(newpic[k],document.all.picdown.checked);
        }
        return;
    }

Leave a Reply

Leave a Reply