Administrator
2024-06-13 cbe19ea6066a600cbd0b5110db5d43f8252d14a8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
static function OnBeforeRequest(oSession: Session) {
 
 
        if(oSession.fullUrl.Contains("https://apphis.longhuvip.com/w1/api/index.php")){
            var requestBody = oSession.GetRequestBodyAsString();
            if(requestBody&&requestBody.Contains("&st=30")){
                oSession.utilReplaceInRequest("&st=30", "&st=100");
                FiddlerObject.log("页码替换为100");
            }
        }
 
}
 
 
 
static function OnBeforeResponse(oSession: Session) {
        if (m_Hide304s && oSession.responseCode == 304) {
            oSession["ui-hide"] = "true";
        }
        if(oSession.fullUrl.Contains("https://apphis.longhuvip.com/w1/api/index.php")){
            var requestBody = oSession.GetRequestBodyAsString();
            var a;
            var pidType;
            var index;
            var day;
            if(requestBody){
                var ps = requestBody.Split("&");
                for(var p in ps){
                    if(ps[p].Contains("a=")){
                        a = ps[p].Replace("a=","");
                    }
                    else if(ps[p].Contains("PidType=")){
                        pidType = ps[p].Replace("PidType=","");
                    }
                    else if(ps[p].Contains("Index=")){
                        index = ps[p].Replace("Index=","");
                    }else if(ps[p].Contains("Day=")){
                        day = ps[p].Replace("Day=","");
                    }
 
 
                }
            }
            FiddlerObject.log("a:"+a+" pidType:"+pidType +" index:"+index);
            if(a){
                var responseStringOriginal = oSession.GetResponseBodyAsString();
                var fso;
                var file;
                fso = new ActiveXObject("Scripting.FileSystemObject");
                //文件保存路径,可自定义
                //第二个参数含义:1=ForReading(以只读方式打开),2=ForWriting (以写方式打开),8=ForAppending(以添加方式打开,写入的内容将添加到文件末尾)
                if(parseInt(index)==0)
                {
                    file = fso.OpenTextFile("D:/kpl/"+day+"_"+a+"_"+pidType+".log",2 ,true, true);
                }else{
                    file = fso.OpenTextFile("D:/kpl/"+day+"_"+a+"_"+pidType+".log",8 ,true, true);
                }
                file.writeLine(responseStringOriginal);
                file.close();
            }
        }
    }