qd-today / templates

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

V2EX 评论区 #32

Open AragonSnow opened 3 years ago

AragonSnow commented 3 years ago

HAR 模板名称

V2EX

作者信息

github-h

模板备注及说明

cookie

每日签到奖励,请自行解决网络问题

https://www.v2ex.com

HAR 文件名

V2EX.har

HAR 模板内容

[
{
    "comment": "获取每日签到值",
    "request":
    {
        "method": "GET",
        "url": "https://www.v2ex.com/",
        "headers": [
        {
            "name": "Host",
            "value": "www.v2ex.com"
        },
        {
            "name": "Connection",
            "value": "keep-alive"
        },
        {
            "name": "sec-ch-ua",
            "value": "\"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\", \"Not=A?Brand\";v=\"24\""
        },
        {
            "name": "sec-ch-ua-mobile",
            "value": "?0"
        },
        {
            "name": "sec-ch-ua-platform",
            "value": "\"Windows\""
        },
        {
            "name": "Upgrade-Insecure-Requests",
            "value": "1"
        },
        {
            "name": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 6.1; 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,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
        },
        {
            "name": "Sec-Fetch-Site",
            "value": "none"
        },
        {
            "name": "Sec-Fetch-Mode",
            "value": "navigate"
        },
        {
            "name": "Sec-Fetch-User",
            "value": "?1"
        },
        {
            "name": "Sec-Fetch-Dest",
            "value": "document"
        },
        {
            "name": "Accept-Encoding",
            "value": "gzip, deflate, br"
        },
        {
            "name": "Accept-Language",
            "value": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6"
        },
        {
            "name": "Cookie",
            "value": "{{cookie}}"
        }],
        "cookies": [],
        "data": "",
        "mimeType": ""
    },
    "rule":
    {
        "success_asserts": [
        {
            "re": "200",
            "from": "status"
        }],
        "failed_asserts": [],
        "extract_variables": []
    }
},
{
    "comment": "获取每日签到值",
    "request":
    {
        "method": "GET",
        "url": "https://www.v2ex.com/mission/daily",
        "headers": [
        {
            "name": "Host",
            "value": "www.v2ex.com"
        },
        {
            "name": "Connection",
            "value": "keep-alive"
        },
        {
            "name": "sec-ch-ua",
            "value": "\"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\", \"Not=A?Brand\";v=\"24\""
        },
        {
            "name": "sec-ch-ua-mobile",
            "value": "?0"
        },
        {
            "name": "sec-ch-ua-platform",
            "value": "\"Windows\""
        },
        {
            "name": "Upgrade-Insecure-Requests",
            "value": "1"
        },
        {
            "name": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 6.1; 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,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
        },
        {
            "name": "Sec-Fetch-Site",
            "value": "none"
        },
        {
            "name": "Sec-Fetch-Mode",
            "value": "navigate"
        },
        {
            "name": "Sec-Fetch-User",
            "value": "?1"
        },
        {
            "name": "Sec-Fetch-Dest",
            "value": "document"
        },
        {
            "name": "Accept-Encoding",
            "value": "gzip, deflate, br"
        },
        {
            "name": "Accept-Language",
            "value": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6"
        },
        {
            "name": "Referer",
            "value": "https://www.v2ex.com/"
        }],
        "cookies": [],
        "data": "",
        "mimeType": ""
    },
    "rule":
    {
        "success_asserts": [
        {
            "re": "200",
            "from": "status"
        }],
        "failed_asserts": [],
        "extract_variables": [
        {
            "name": "once_daily",
            "re": "once=(.+?)'",
            "from": "content"
        }]
    }
},
{
    "comment": "签到请求",
    "request":
    {
        "method": "GET",
        "url": "https://www.v2ex.com/mission/daily/redeem?once={{once_daily|urlencode}}",
        "headers": [
        {
            "name": "Host",
            "value": "www.v2ex.com"
        },
        {
            "name": "Connection",
            "value": "keep-alive"
        },
        {
            "name": "sec-ch-ua",
            "value": "\"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\", \"Not=A?Brand\";v=\"24\""
        },
        {
            "name": "sec-ch-ua-mobile",
            "value": "?0"
        },
        {
            "name": "sec-ch-ua-platform",
            "value": "\"Windows\""
        },
        {
            "name": "Upgrade-Insecure-Requests",
            "value": "1"
        },
        {
            "name": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 6.1; 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,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
        },
        {
            "name": "Sec-Fetch-Site",
            "value": "same-origin"
        },
        {
            "name": "Sec-Fetch-Mode",
            "value": "navigate"
        },
        {
            "name": "Sec-Fetch-User",
            "value": "?1"
        },
        {
            "name": "Sec-Fetch-Dest",
            "value": "document"
        },
        {
            "name": "Referer",
            "value": "https://www.v2ex.com/mission/daily"
        },
        {
            "name": "Accept-Encoding",
            "value": "gzip, deflate, br"
        },
        {
            "name": "Accept-Language",
            "value": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6"
        }],
        "cookies": [],
        "data": "",
        "mimeType": ""
    },
    "rule":
    {
        "success_asserts": [
        {
            "re": "302",
            "from": "status"
        }],
        "failed_asserts": [],
        "extract_variables": []
    }
},
{
    "comment": "判断签到成功+获取签到天数",
    "request":
    {
        "method": "GET",
        "url": "https://www.v2ex.com/mission/daily",
        "headers": [
        {
            "name": "Host",
            "value": "www.v2ex.com"
        },
        {
            "name": "Connection",
            "value": "keep-alive"
        },
        {
            "name": "Upgrade-Insecure-Requests",
            "value": "1"
        },
        {
            "name": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 6.1; 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,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
        },
        {
            "name": "Sec-Fetch-Site",
            "value": "same-origin"
        },
        {
            "name": "Sec-Fetch-Mode",
            "value": "navigate"
        },
        {
            "name": "Sec-Fetch-User",
            "value": "?1"
        },
        {
            "name": "Sec-Fetch-Dest",
            "value": "document"
        },
        {
            "name": "sec-ch-ua",
            "value": "\"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\", \"Not=A?Brand\";v=\"24\""
        },
        {
            "name": "sec-ch-ua-mobile",
            "value": "?0"
        },
        {
            "name": "sec-ch-ua-platform",
            "value": "\"Windows\""
        },
        {
            "name": "Referer",
            "value": "https://www.v2ex.com/mission/daily"
        },
        {
            "name": "Accept-Encoding",
            "value": "gzip, deflate, br"
        },
        {
            "name": "Accept-Language",
            "value": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6"
        }],
        "cookies": [],
        "data": "",
        "mimeType": ""
    },
    "rule":
    {
        "success_asserts": [
        {
            "re": "200",
            "from": "status"
        },
        {
            "re": "每日登录奖励已领取",
            "from": "content"
        }],
        "failed_asserts": [
        {
            "re": "领取 X 铜币",
            "from": "content"
        }],
        "extract_variables": [
        {
            "name": "log_days",
            "re": "已连续登录(.+?)天",
            "from": "content"
        }]
    }
},
{
    "comment": "获取签到奖励",
    "request":
    {
        "method": "GET",
        "url": "https://www.v2ex.com/balance",
        "headers": [
        {
            "name": "Host",
            "value": "www.v2ex.com"
        },
        {
            "name": "Connection",
            "value": "keep-alive"
        },
        {
            "name": "Upgrade-Insecure-Requests",
            "value": "1"
        },
        {
            "name": "User-Agent",
            "value": "Mozilla/5.0 (Windows NT 6.1; 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,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
        },
        {
            "name": "Sec-Fetch-Site",
            "value": "same-origin"
        },
        {
            "name": "Sec-Fetch-Mode",
            "value": "navigate"
        },
        {
            "name": "Sec-Fetch-User",
            "value": "?1"
        },
        {
            "name": "Sec-Fetch-Dest",
            "value": "document"
        },
        {
            "name": "sec-ch-ua",
            "value": "\"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\", \"Not=A?Brand\";v=\"24\""
        },
        {
            "name": "sec-ch-ua-mobile",
            "value": "?0"
        },
        {
            "name": "sec-ch-ua-platform",
            "value": "\"Windows\""
        },
        {
            "name": "Referer",
            "value": "https://www.v2ex.com/mission/daily"
        },
        {
            "name": "Accept-Encoding",
            "value": "gzip, deflate, br"
        },
        {
            "name": "Accept-Language",
            "value": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6"
        }],
        "cookies": [],
        "data": "",
        "mimeType": ""
    },
    "rule":
    {
        "success_asserts": [
        {
            "re": "200",
            "from": "status"
        }],
        "failed_asserts": [],
        "extract_variables": [
        {
            "name": "log_value",
            "re": "每日登录奖励(.+?)铜币",
            "from": "content"
        }]
    }
},
{
    "comment": "生成日志",
    "request":
    {
        "method": "POST",
        "url": "api://util/urldecode",
        "headers": [],
        "cookies": [],
        "data": "content=已连续登录 {{log_days}} 天 , 每日登录奖励 {{log_value}} 铜币"
    },
    "rule":
    {
        "success_asserts": [
        {
            "re": "200",
            "from": "status"
        },
        {
            "re": "\"状态\": \"200\"",
            "from": "content"
        }],
        "failed_asserts": [],
        "extract_variables": [
        {
            "name": "__log__",
            "re": "\"转换后\": \"(.*)\"",
            "from": "content"
        }]
    }
}]
Showfom commented 1 year ago

今天执行的时候失败

2023-01-11 08:02:36
日志:Failed at 3/5 request,
Fail assert: {"re": "领取 X 铜币", "from": "content"} from failed_asserts,
Request URL: https://www.v2ex.com/mission/daily
Felix2yu commented 1 year ago

有时候成功,有时候又失败

v2ex | 2023-1-26 7:31:15 | 失败 | Failed at 3/5 request, Fail assert: {"re": "领取 X 铜币", "from": "content"} from failed_asserts, Request URL: https://www.v2ex.com/mission/daily
v2ex | 2023-1-25 7:31:12 | 成功 | 铜币奖励: 6   总天数: 1078
v2ex | 2023-1-24 20:31:11 | 失败 | Failed at 3/5 request, Fail assert: {"re": "领取 X 铜币", "from": "content"} from failed_asserts, Request URL: https://www.v2ex.com/mission/daily
v2ex | 2023-1-24 14:31:09 | 失败 | Failed at 3/5 request, Fail assert: {"re": "领取 X 铜币", "from": "content"} from failed_asserts, Request URL: https://www.v2ex.com/mission/daily
v2ex | 2023-1-24 13:47:48 | 失败 | Failed at 3/5 request, Fail assert: {"re": "领取 X 铜币", "from": "content"} from failed_asserts, Request URL: https://www.v2ex.com/mission/daily
v2ex | 2023-1-24 13:47:44 | 失败 | Failed at 3/5 request, Fail assert: {"re": "领取 X 铜币", "from": "content"} from failed_asserts, Request URL: https://www.v2ex.com/mission/daily
v2ex | 2023-1-24 13:47:28 | 失败 | Failed at 3/5 request, Fail assert: {"re": "领取 X 铜币", "from": "content"} from failed_asserts, Request URL: https://www.v2ex.com/mission/daily
v2ex | 2023-1-23 14:31:07 | 成功 | 铜币奖励: 18   总天数: 1077
yushizui commented 9 months ago

挂了,Enable JavaScript and cookies to continue