qd-today / templates

基于开源新版 QD 框架站发布的公共har模板库,仅供示例
1.08k stars 294 forks source link

KDays论坛 评论区 #57

Open github-h opened 3 years ago

github-h commented 3 years ago

HAR 模板名称

KDays论坛

作者信息

github-h

模板备注及说明

username/password

每日签到奖励

https://uc.kdays.net

HAR 文件名

KDays论坛.har

HAR 模板内容

[
{
    "comment": "获取akari",
    "request":
    {
        "method": "GET",
        "url": "https://uc.kdays.net/sso/login/?client_id=kd.uc",
        "headers": [
        {
            "name": "Host",
            "value": "uc.kdays.net"
        },
        {
            "name": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
        },
        {
            "name": "Accept",
            "value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
        },
        {
            "name": "Accept-Language",
            "value": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2"
        },
        {
            "name": "Accept-Encoding",
            "value": "gzip, deflate"
        },
        {
            "name": "Referer",
            "value": "http://bbs2.kdays.net/index"
        },
        {
            "name": "DNT",
            "value": "1"
        },
        {
            "name": "Connection",
            "value": "keep-alive"
        },
        {
            "name": "Upgrade-Insecure-Requests",
            "value": "1"
        }],
        "cookies": [],
        "data": "",
        "mimeType": ""
    },
    "rule":
    {
        "success_asserts": [
        {
            "re": "200",
            "from": "status"
        }],
        "failed_asserts": [],
        "extract_variables": [
        {
            "re": "name=\"_akari\" value=\"(.+?)\"",
            "from": "content",
            "name": "akari"
        }]
    }
},
{
    "comment": "登录",
    "request":
    {
        "method": "POST",
        "url": "https://uc.kdays.net/sso/login/authorize",
        "headers": [
        {
            "name": "Host",
            "value": "uc.kdays.net"
        },
        {
            "name": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
        },
        {
            "name": "Accept",
            "value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"
        },
        {
            "name": "Accept-Language",
            "value": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2"
        },
        {
            "name": "Accept-Encoding",
            "value": "gzip, deflate, br"
        },
        {
            "name": "Content-Type",
            "value": "application/x-www-form-urlencoded"
        },
        {
            "name": "Origin",
            "value": "http://uc.kdays.net"
        },
        {
            "name": "DNT",
            "value": "1"
        },
        {
            "name": "Connection",
            "value": "keep-alive"
        },
        {
            "name": "Referer",
            "value": "http://uc.kdays.net//sso/login/?service=http%3A%2F%2Fbbs.kdays.net%2Findex"
        },
        {
            "name": "Upgrade-Insecure-Requests",
            "value": "1"
        }],
        "cookies": [],
        "data": "_akari={{akari|urlencode}}&lgt=input&app_id=2&redirect_uri=&state=login&input={{username|urlencode}}&password={{password|urlencode}}",
        "mimeType": "application/x-www-form-urlencoded"
    },
    "rule":
    {
        "success_asserts": [
        {
            "re": "200",
            "from": "status"
        },
        {
            "re": "302",
            "from": "status"
        }],
        "failed_asserts": [
        {
            "re": "表单验证失败",
            "from": "content"
        }],
        "extract_variables": [
        {
            "re": "code=(.+?)&",
            "from": "header-location",
            "name": "location"
        }]
    }
},
{
    "comment": "跳转登录",
    "request":
    {
        "method": "GET",
        "url": "https://bbs2.kdays.net//h/kduc?action=authorize&code={{location|urlencode}}&state=login&redirect_uri=https%3A%2F%2Fbbs.kdays.net%2F",
        "headers": [
        {
            "name": "Host",
            "value": "bbs2.kdays.net"
        },
        {
            "name": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
        },
        {
            "name": "Accept",
            "value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"
        },
        {
            "name": "Accept-Language",
            "value": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2"
        },
        {
            "name": "Accept-Encoding",
            "value": "gzip, deflate, br"
        },
        {
            "name": "Referer",
            "value": "http://uc.kdays.net//sso/login/?service=http%3A%2F%2Fbbs.kdays.net%2Findex"
        },
        {
            "name": "DNT",
            "value": "1"
        },
        {
            "name": "Connection",
            "value": "keep-alive"
        },
        {
            "name": "Upgrade-Insecure-Requests",
            "value": "1"
        }],
        "cookies": [],
        "data": "",
        "mimeType": ""
    },
    "rule":
    {
        "success_asserts": [
        {
            "re": "200",
            "from": "status"
        },
        {
            "re": "302",
            "from": "status"
        }],
        "failed_asserts": [
        {
            "re": "login_failed",
            "from": "content"
        }],
        "extract_variables": []
    }
},
{
    "comment": "获取akari0",
    "request":
    {
        "method": "GET",
        "url": "https://bbs2.kdays.net/h/task",
        "headers": [
        {
            "name": "Host",
            "value": "bbs2.kdays.net"
        },
        {
            "name": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
        },
        {
            "name": "Accept",
            "value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"
        },
        {
            "name": "Accept-Language",
            "value": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2"
        },
        {
            "name": "Accept-Encoding",
            "value": "gzip, deflate, br"
        },
        {
            "name": "DNT",
            "value": "1"
        },
        {
            "name": "Connection",
            "value": "keep-alive"
        },
        {
            "name": "Referer",
            "value": "https://bbs2.kdays.net/"
        },
        {
            "name": "Upgrade-Insecure-Requests",
            "value": "1"
        },
        {
            "name": "Sec-Fetch-Dest",
            "value": "document"
        },
        {
            "name": "Sec-Fetch-Mode",
            "value": "navigate"
        },
        {
            "name": "Sec-Fetch-Site",
            "value": "same-origin"
        },
        {
            "name": "Sec-Fetch-User",
            "value": "?1"
        }],
        "cookies": [],
        "data": "",
        "mimeType": ""
    },
    "rule":
    {
        "success_asserts": [
        {
            "re": "200",
            "from": "status"
        }],
        "failed_asserts": [],
        "extract_variables": [
        {
            "name": "akari0",
            "re": "name=\"_akari\" value=\"(.+?)\"",
            "from": "content"
        }]
    }
},
{
    "comment": "签到",
    "request":
    {
        "method": "POST",
        "url": "https://bbs2.kdays.net/h/task?action=check",
        "headers": [
        {
            "name": "Host",
            "value": "bbs2.kdays.net"
        },
        {
            "name": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
        },
        {
            "name": "Accept",
            "value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"
        },
        {
            "name": "Accept-Language",
            "value": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2"
        },
        {
            "name": "Accept-Encoding",
            "value": "gzip, deflate, br"
        },
        {
            "name": "Content-Type",
            "value": "application/x-www-form-urlencoded"
        },
        {
            "name": "Origin",
            "value": "https://bbs2.kdays.net"
        },
        {
            "name": "DNT",
            "value": "1"
        },
        {
            "name": "Connection",
            "value": "keep-alive"
        },
        {
            "name": "Referer",
            "value": "https://bbs2.kdays.net/h/task"
        },
        {
            "name": "Upgrade-Insecure-Requests",
            "value": "1"
        },
        {
            "name": "Sec-Fetch-Dest",
            "value": "document"
        },
        {
            "name": "Sec-Fetch-Mode",
            "value": "navigate"
        },
        {
            "name": "Sec-Fetch-Site",
            "value": "same-origin"
        },
        {
            "name": "Sec-Fetch-User",
            "value": "?1"
        }],
        "cookies": [],
        "data": "_akari={{akari0|urlencode}}&task=SigninTask&id=qd",
        "mimeType": "application/x-www-form-urlencoded"
    },
    "rule":
    {
        "success_asserts": [
        {
            "re": "200",
            "from": "status"
        }],
        "failed_asserts": [],
        "extract_variables": []
    }
},
{
    "comment": "判断签到是否成功",
    "request":
    {
        "method": "GET",
        "url": "https://bbs2.kdays.net/h/task",
        "headers": [
        {
            "name": "Host",
            "value": "bbs2.kdays.net"
        },
        {
            "name": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
        },
        {
            "name": "Accept",
            "value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8"
        },
        {
            "name": "Accept-Language",
            "value": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2"
        },
        {
            "name": "Accept-Encoding",
            "value": "gzip, deflate, br"
        },
        {
            "name": "DNT",
            "value": "1"
        },
        {
            "name": "Connection",
            "value": "keep-alive"
        },
        {
            "name": "Referer",
            "value": "https://bbs2.kdays.net/h/task?action=check"
        },
        {
            "name": "Upgrade-Insecure-Requests",
            "value": "1"
        },
        {
            "name": "Sec-Fetch-Dest",
            "value": "document"
        },
        {
            "name": "Sec-Fetch-Mode",
            "value": "navigate"
        },
        {
            "name": "Sec-Fetch-Site",
            "value": "same-origin"
        }],
        "cookies": [],
        "data": "",
        "mimeType": ""
    },
    "rule":
    {
        "success_asserts": [
        {
            "re": "200",
            "from": "status"
        }],
        "failed_asserts": [
        {
            "re": "打卡签到",
            "from": "content"
        }],
        "extract_variables": []
    }
},
{
    "comment": "获取积分",
    "request":
    {
        "method": "GET",
        "url": "https://bbs2.kdays.net/my/credit",
        "headers": [
        {
            "name": "Host",
            "value": "bbs2.kdays.net"
        },
        {
            "name": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
        },
        {
            "name": "Accept",
            "value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
        },
        {
            "name": "Accept-Language",
            "value": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2"
        },
        {
            "name": "Accept-Encoding",
            "value": "gzip, deflate"
        },
        {
            "name": "Referer",
            "value": "http://bbs2.kdays.net/notify/list"
        },
        {
            "name": "DNT",
            "value": "1"
        },
        {
            "name": "Connection",
            "value": "keep-alive"
        },
        {
            "name": "Upgrade-Insecure-Requests",
            "value": "1"
        },
        {
            "name": "Cache-Control",
            "value": "max-age=0"
        }],
        "cookies": [],
        "data": "",
        "mimeType": ""
    },
    "rule":
    {
        "success_asserts": [
        {
            "re": "200",
            "from": "status"
        }],
        "failed_asserts": [
        {
            "re": "你还没有登录论坛",
            "from": "content"
        }],
        "extract_variables": [
        {
            "re": "坑币</b>(.+)</li>",
            "from": "content",
            "name": "log_value"
        }]
    }
},
{
    "comment": "生成日志",
    "request":
    {
        "method": "POST",
        "url": "api://util/urldecode",
        "headers": [],
        "cookies": [],
        "data": "content=坑币: {{log_value}}"
    },
    "rule":
    {
        "success_asserts": [
        {
            "re": "200",
            "from": "status"
        },
        {
            "re": "\"状态\": \"200\"",
            "from": "content"
        }],
        "failed_asserts": [],
        "extract_variables": [
        {
            "name": "__log__",
            "re": "\"转换后\": \"(.*)\"",
            "from": "content"
        }]
    }
}]
gexadew commented 2 years ago

2022-04-24 11:50:35 日志:Failed at 3/6 request, Fail assert: {"re": "登录成功", "from": "content"} from success_asserts, Response Error : HTTP 302: Found, Request URL: {{toUrl}} 报错如下 请问怎么操作呢。

hhhllll888 commented 3 weeks ago

2024-10-26 16:07:27 日志:Failed at 3/8 request, Fail assert: {"re": "302", "from": "status"} from success_asserts, Response Error : HTTP 599: Recv failure: Connection reset by peer, Request URL: https://bbs2.kdays.net//h/kduc?action=authorize&code={{location|urlencode}}&state=login&redirect_uri=https%3A%2F%2Fbbs.kdays.net%2F

报错