Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

立创开源平台签到 #785

Open
2117516450 opened this issue Nov 6, 2024 · 15 comments
Open

立创开源平台签到 #785

2117516450 opened this issue Nov 6, 2024 · 15 comments
Labels

Comments

@2117516450
Copy link
Contributor

2117516450 commented Nov 6, 2024

HAR 模板名称

立创开源平台签到.har

作者信息

五月

模板备注及说明

用于立创开源平台签到获取积分
需要https://passport.jlc.com/login下所有cookie

HAR 文件名

立创开源平台签到.har

其他信息

No response

HAR 模板内容

[
  {
    "comment": "初始化变量",
    "request": {
      "method": "POST",
      "url": "api://util/string/replace",
      "headers": [],
      "cookies": [],
      "data": "r=text&p=&s=1&t="
    },
    "rule": {
      "success_asserts": [
        {
          "re": "200",
          "from": "status"
        }
      ],
      "failed_asserts": [],
      "extract_variables": [
        {
          "name": "time16",
          "re": "",
          "from": "content"
        },
        {
          "name": "cookies",
          "re": "",
          "from": "content"
        },
        {
          "name": "success",
          "re": "",
          "from": "content"
        },
        {
          "name": "result",
          "re": "",
          "from": "content"
        },
        {
          "name": "code",
          "re": "",
          "from": "content"
        },
        {
          "name": "isTodaySignIn",
          "re": "",
          "from": "content"
        },
        {
          "name": "latestSignInDate",
          "re": "",
          "from": "content"
        },
        {
          "name": "total_point",
          "re": "",
          "from": "content"
        }
      ]
    }
  },
  {
    "comment": "返回对应时间戳和时间",
    "request": {
      "method": "POST",
      "url": "api://util/timestamp",
      "headers": [],
      "cookies": [],
      "data": "ts=&form=&dt="
    },
    "rule": {
      "success_asserts": [
        {
          "re": "200",
          "from": "status"
        }
      ],
      "failed_asserts": [],
      "extract_variables": [
        {
          "name": "time16",
          "re": "\"16位时间戳\":(.*?),",
          "from": "content"
        }
      ]
    }
  },
  {
    "comment": "获取oshwhub_session的code",
    "request": {
      "method": "POST",
      "url": "https://passport.jlc.com/api/cas/sso/check-login",
      "headers": [
        {
          "name": "Content-Type\n",
          "value": "application/json;charset=UTF-8\n"
        },
        {
          "name": "Cookie\n",
          "value": "{{cookie}}"
        }
      ],
      "cookies": [],
      "data": "{\"appId\":\"JLC_OSHWHUB\"}",
      "mimeType": "application/json"
    },
    "rule": {
      "success_asserts": [
        {
          "re": "\"isLogin\":true",
          "from": "content"
        }
      ],
      "failed_asserts": [
        {
          "re": "\"isLogin\":false,\"loginEnabled\":false",
          "from": "content"
        }
      ],
      "extract_variables": [
        {
          "name": "code",
          "re": "\"code\":\"(.*?)\"",
          "from": "content"
        }
      ]
    }
  },
  {
    "comment": "获取oshwhub_session",
    "request": {
      "method": "POST",
      "url": "https://oshwhub.com/api/login/login-by-code",
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json;charset=UTF-8"
        }
      ],
      "cookies": [],
      "data": "{\"code\":\"{{code}}\"}",
      "mimeType": "application/json"
    },
    "rule": {
      "success_asserts": [
        {
          "re": "\"result\":{}",
          "from": "content"
        }
      ],
      "failed_asserts": [
        {
          "re": "\"result\":\"请求签名参数错误\"",
          "from": "content"
        }
      ],
      "extract_variables": [
        {
          "name": "cookies",
          "re": "Set-Cookie:(.*); Max-Age=604800;",
          "from": "header"
        }
      ]
    }
  },
  {
    "comment": "获取是否签到过",
    "request": {
      "method": "GET",
      "url": "https://oshwhub.com/api/users/getSignInProfile?_t={{time16|truncate(14,True,'',0)|urlencode}}",
      "headers": [
        {
          "name": "cookie",
          "value": "{{cookies}}"
        },
        {
          "name": "Accept",
          "value": "application/json, text/plain, */*"
        },
        {
          "name": "Accept-Encoding",
          "value": "gzip, deflate, br, zstd"
        },
        {
          "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": "Connection",
          "value": "keep-alive"
        },
        {
          "name": "Content-Type",
          "value": "application/json;charset=UTF-8"
        },
        {
          "name": "DNT",
          "value": "1"
        },
        {
          "name": "Host",
          "value": "oshwhub.com"
        },
        {
          "name": "Origin",
          "value": "https://oshwhub.com"
        },
        {
          "name": "Referer",
          "value": "https://oshwhub.com/sign_in"
        },
        {
          "name": "Sec-Fetch-Dest",
          "value": "empty"
        },
        {
          "name": "Sec-Fetch-Mode",
          "value": "cors"
        },
        {
          "name": "Sec-Fetch-Site",
          "value": "same-origin"
        },
        {
          "name": "User-Agent",
          "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0"
        },
        {
          "name": "sec-ch-ua",
          "value": "\"Chromium\";v=\"130\", \"Microsoft Edge\";v=\"130\", \"Not?A_Brand\";v=\"99\""
        },
        {
          "name": "sec-ch-ua-mobile",
          "value": "?0"
        },
        {
          "name": "sec-ch-ua-platform",
          "value": "\"Windows\""
        }
      ],
      "cookies": [],
      "data": "",
      "mimeType": "application/json;charset=UTF-8"
    },
    "rule": {
      "success_asserts": [
        {
          "re": "200",
          "from": "status"
        }
      ],
      "failed_asserts": [
        {
          "re": "\"code\":401,",
          "from": "content"
        }
      ],
      "extract_variables": [
        {
          "name": "cookies",
          "re": "Set-Cookie:(.*)Max-Age=604800;",
          "from": "header"
        },
        {
          "name": "isTodaySignIn",
          "re": "\"isTodaySignIn\":(.*),\"latestSignInDate\"",
          "from": "content"
        },
        {
          "name": "latestSignInDate",
          "re": "\"latestSignInDate\":\"(.*)\",\"",
          "from": "content"
        },
        {
          "name": "total_point",
          "re": "\"total_point\":(.*),\"expiring_info\"",
          "from": "content"
        }
      ]
    }
  },
  {
    "comment": "判断条件成立 是否签到过",
    "request": {
      "method": "GET",
      "url": "{% if isTodaySignIn == \"true\" %}",
      "headers": [],
      "cookies": [],
      "data": ""
    },
    "rule": {
      "success_asserts": [],
      "failed_asserts": [],
      "extract_variables": []
    }
  },
  {
    "comment": "",
    "request": {
      "method": "GET",
      "url": "api://util/string/replace?r=text&p=&s=%E4%BB%8A%E6%97%A5%E5%B7%B2%E7%AD%BE%E5%88%B0%E2%97%86%E7%A7%AF%E5%88%86%E6%80%BB%E6%95%B0%EF%BC%9A{{total_point|urlencode}}%E2%97%86%E6%9C%80%E8%BF%91%E7%AD%BE%E5%88%B0%E6%97%B6%E9%97%B4%EF%BC%9A{{latestSignInDate|urlencode}}%EF%BC%88%2B8%3A00%EF%BC%89&t=",
      "headers": [],
      "cookies": [],
      "data": ""
    },
    "rule": {
      "success_asserts": [],
      "failed_asserts": [],
      "extract_variables": [
        {
          "name": "__log__",
          "re": "(.*)",
          "from": "content"
        }
      ]
    }
  },
  {
    "comment": "判断条件不成立",
    "request": {
      "method": "GET",
      "url": "{% else %}",
      "headers": [],
      "cookies": [],
      "data": ""
    },
    "rule": {
      "success_asserts": []
    }
  },
  {
    "comment": "提交签到请求",
    "request": {
      "method": "POST",
      "url": "https://oshwhub.com/api/users/signIn",
      "headers": [
        {
          "name": "cookie",
          "value": "{{cookies}}"
        },
        {
          "name": "Accept",
          "value": "application/json, text/plain, */*"
        },
        {
          "name": "Accept-Encoding",
          "value": "gzip, deflate, br, zstd"
        },
        {
          "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": "Connection",
          "value": "keep-alive"
        },
        {
          "name": "Content-Type",
          "value": "application/json;charset=UTF-8"
        },
        {
          "name": "DNT",
          "value": "1"
        },
        {
          "name": "Host",
          "value": "oshwhub.com"
        },
        {
          "name": "Origin",
          "value": "https://oshwhub.com"
        },
        {
          "name": "Referer",
          "value": "https://oshwhub.com/sign_in"
        },
        {
          "name": "Sec-Fetch-Dest",
          "value": "empty"
        },
        {
          "name": "Sec-Fetch-Mode",
          "value": "cors"
        },
        {
          "name": "Sec-Fetch-Site",
          "value": "same-origin"
        },
        {
          "name": "User-Agent",
          "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0"
        },
        {
          "name": "sec-ch-ua",
          "value": "\"Chromium\";v=\"130\", \"Microsoft Edge\";v=\"130\", \"Not?A_Brand\";v=\"99\""
        },
        {
          "name": "sec-ch-ua-mobile",
          "value": "?0"
        },
        {
          "name": "sec-ch-ua-platform",
          "value": "\"Windows\""
        }
      ],
      "cookies": [],
      "data": "{\"_t\":{{time16|truncate(14,True,'',0)}}}",
      "mimeType": "application/json;charset=UTF-8"
    },
    "rule": {
      "success_asserts": [
        {
          "re": "200",
          "from": "status"
        }
      ],
      "failed_asserts": [
        {
          "re": "\"code\":401,",
          "from": "content"
        }
      ],
      "extract_variables": [
        {
          "name": "code",
          "re": "\"code\":(.*?),",
          "from": "content"
        },
        {
          "name": "success",
          "re": "\"success\":(.*?),",
          "from": "content"
        },
        {
          "name": "result",
          "re": "\"result\":(.*?)(})",
          "from": "content"
        },
        {
          "name": "cookies",
          "re": "Set-Cookie:(.*)Max-Age=604800;",
          "from": "header"
        }
      ]
    }
  },
  {
    "comment": "判断条件成立",
    "request": {
      "method": "GET",
      "url": "{% if result != \"true\" %}",
      "headers": [],
      "cookies": [],
      "data": ""
    },
    "rule": {
      "success_asserts": [],
      "failed_asserts": [],
      "extract_variables": []
    }
  },
  {
    "comment": "获取签到时间",
    "request": {
      "method": "GET",
      "url": "https://oshwhub.com/api/users/signInRecord?startTime={{timestamp()|int-172800}}000&endTime={{timestamp()|int+172800}}000",
      "headers": [
        {
          "name": "cookie",
          "value": "{{cookies}}"
        }
      ],
      "cookies": []
    },
    "rule": {
      "success_asserts": [
        {
          "re": "200",
          "from": "status"
        },
        {
          "re": "\"code\":0",
          "from": "content"
        }
      ],
      "failed_asserts": [],
      "extract_variables": [
        {
          "name": "date",
          "re": "\"result\":(.*)(})",
          "from": "content"
        }
      ]
    }
  },
  {
    "comment": "签到失败",
    "request": {
      "method": "GET",
      "url": "api://util/string/replace?r=text&p=&s=%E7%AD%BE%E5%88%B0%E5%A4%B1%E8%B4%A5%20%20%E6%9C%80%E8%BF%91%E7%AD%BE%E5%88%B0%E6%97%B6%E9%97%B4%EF%BC%9A{{date|urlencode}}&t=",
      "headers": [],
      "cookies": [],
      "data": ""
    },
    "rule": {
      "success_asserts": [],
      "failed_asserts": [],
      "extract_variables": [
        {
          "name": "__log__",
          "re": "(.*)",
          "from": "content"
        }
      ]
    }
  },
  {
    "comment": "判断条件不成立",
    "request": {
      "method": "GET",
      "url": "{% else %}",
      "headers": [],
      "cookies": [],
      "data": ""
    },
    "rule": {
      "success_asserts": [],
      "failed_asserts": [],
      "extract_variables": []
    }
  },
  {
    "comment": "延时2秒",
    "request": {
      "method": "GET",
      "url": "api://util/delay/2",
      "headers": [],
      "cookies": [],
      "data": ""
    },
    "rule": {
      "success_asserts": [
        {
          "re": "200",
          "from": "status"
        }
      ],
      "failed_asserts": [],
      "extract_variables": []
    }
  },
  {
    "comment": "签到成功,获取今日签到信息",
    "request": {
      "method": "GET",
      "url": "https://oshwhub.com/api/users/getSignInProfile?_t={{time16|truncate(14,True,'',0)|urlencode}}",
      "headers": [
        {
          "name": "cookie",
          "value": "{{cookies}}"
        },
        {
          "name": "Accept",
          "value": "application/json, text/plain, */*"
        },
        {
          "name": "Accept-Encoding",
          "value": "gzip, deflate, br, zstd"
        },
        {
          "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": "Connection",
          "value": "keep-alive"
        },
        {
          "name": "Content-Type",
          "value": "application/json;charset=UTF-8"
        },
        {
          "name": "DNT",
          "value": "1"
        },
        {
          "name": "Host",
          "value": "oshwhub.com"
        },
        {
          "name": "Origin",
          "value": "https://oshwhub.com"
        },
        {
          "name": "Referer",
          "value": "https://oshwhub.com/sign_in"
        },
        {
          "name": "Sec-Fetch-Dest",
          "value": "empty"
        },
        {
          "name": "Sec-Fetch-Mode",
          "value": "cors"
        },
        {
          "name": "Sec-Fetch-Site",
          "value": "same-origin"
        },
        {
          "name": "User-Agent",
          "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0"
        },
        {
          "name": "sec-ch-ua",
          "value": "\"Chromium\";v=\"130\", \"Microsoft Edge\";v=\"130\", \"Not?A_Brand\";v=\"99\""
        },
        {
          "name": "sec-ch-ua-mobile",
          "value": "?0"
        },
        {
          "name": "sec-ch-ua-platform",
          "value": "\"Windows\""
        }
      ],
      "cookies": [],
      "data": "",
      "mimeType": "application/json;charset=UTF-8"
    },
    "rule": {
      "success_asserts": [
        {
          "re": "200",
          "from": "status"
        }
      ],
      "failed_asserts": [
        {
          "re": "\"code\":401,",
          "from": "content"
        }
      ],
      "extract_variables": [
        {
          "name": "cookies",
          "re": "Set-Cookie:(.*)Max-Age=604800;",
          "from": "header"
        },
        {
          "name": "isTodaySignIn",
          "re": "\"isTodaySignIn\":(.*),\"latestSignInDate\"",
          "from": "content"
        },
        {
          "name": "latestSignInDate",
          "re": "\"latestSignInDate\":\"(.*)\",\"",
          "from": "content"
        }
      ]
    }
  },
  {
    "comment": "",
    "request": {
      "method": "GET",
      "url": "api://util/string/replace?r=text&p=&s=%E7%AD%BE%E5%88%B0%E6%88%90%E5%8A%9F%E2%97%86%E7%A7%AF%E5%88%86%E6%80%BB%E6%95%B0%EF%BC%9A{{total_point|urlencode}}%E2%97%86%E7%AD%BE%E5%88%B0%E6%97%B6%E9%97%B4%EF%BC%9A{{latestSignInDate|urlencode}}%EF%BC%88%2B8%3A00%EF%BC%89%0A&t=",
      "headers": [],
      "cookies": [],
      "data": ""
    },
    "rule": {
      "success_asserts": [
        {
          "re": "{{code|urlencode}}",
          "from": "content"
        }
      ],
      "failed_asserts": [],
      "extract_variables": [
        {
          "name": "__log__",
          "re": "(.*)",
          "from": "content"
        }
      ]
    }
  },
  {
    "comment": "判断块结束",
    "request": {
      "method": "GET",
      "url": "{% endif %}",
      "headers": [],
      "cookies": [],
      "data": ""
    },
    "rule": {
      "success_asserts": []
    }
  },
  {
    "comment": "判断块结束",
    "request": {
      "method": "GET",
      "url": "{% endif %}",
      "headers": [],
      "cookies": [],
      "data": ""
    },
    "rule": {
      "success_asserts": [],
      "failed_asserts": [],
      "extract_variables": []
    }
  }
]
@2117516450
Copy link
Contributor Author

image

@icaca
Copy link

icaca commented Nov 6, 2024

可以用 赞

@yinzai2024
Copy link

Failed at 4/18 request,
Fail assert: {"re": ""result":{}", "from": "content"} from success_asserts,
Response Error : HTTP 302: Found,
Request URL: https://oshwhub.com/api/login/login-by-code

@icaca
Copy link

icaca commented Nov 7, 2024

Failed at 4/18 request, Fail assert: {"re": ""result":{}", "from": "content"} from success_asserts, Response Error : HTTP 302: Found, Request URL: https://oshwhub.com/api/login/login-by-code-----------谷歌翻译-----------4/18 请求失败,失败断言:来自 success_asserts 的 {"re": ""result":{}", "from": "content"},响应错误:HTTP 302:找到,请求网址:

你自己登录下 要填个东西 提交就好了

@yinzai2024
Copy link

https://oshwhub.com/api/login/login-by-code

大佬,这个页面打不开,挂梯子全局也打不开

@icaca
Copy link

icaca commented Nov 7, 2024

不是这个地址 就是说明里那个获取所有cookie的地址 我昨天也是 好久没登录了 也跳302

@2879597772
Copy link

https://oshwhub.com/api/login/login-by-code

大佬,这个页面打不开,挂梯子全局也打不开

正确填写cookie啊,上面有写要哪个页面的cookie

@yinzai2024
Copy link

Get-Cookies 插件获取的cookie 不管用哈,F12查看也不知道用哪个
1

@2879597772
Copy link

Get-Cookies 插件获取的cookie 不管用哈,F12查看也不知道用哪个 1

直接看网络请求里面的,要是没法分辨,全复制进去
image

@yinzai2024
Copy link

大佬,已经把cookie里的全部复制进去了,还是报错
2024-11-07 12:50:00
日志:Failed at 4/18 request,
Fail assert: {"re": ""result":{}", "from": "content"} from success_asserts,
Response Error : HTTP 302: Found,
Request URL: https://oshwhub.com/api/login/login-by-code
1

@2879597772
Copy link

大佬,已经把cookie里的全部复制进去了,还是报错 2024-11-07 12:50:00 日志:Failed at 4/18 request, Fail assert: {"re": ""result":{}", "from": "content"} from success_asserts, Response Error : HTTP 302: Found, Request URL: https://oshwhub.com/api/login/login-by-code 1

...... 你的账号是已经登陆的情况下进入的这个页面吗?

@yinzai2024
Copy link

大佬,已经把cookie里的全部复制进去了,还是报错 2024-11-07 12:50:00 日志:Failed at 4/18 request, Fail assert: {"re": ""result":{}", "from": "content"} from success_asserts, Response Error : HTTP 302: Found, Request URL: https://oshwhub.com/api/login/login-by-code 1

...... 你的账号是已经登陆的情况下进入的这个页面吗?

是的,已登录界面获取的CK,,大佬给个联系方式吧,我加你

@rickychaw
Copy link

大佬,已经把cookie里的全部复制进去了,还是报错 2024-11-07 12:50:00 日志:Failed at 4/18 request, Fail assert: {"re": ""result":{}", "from": "content"} from success_asserts, Response Error : HTTP 302: Found, Request URL: https://oshwhub.com/api/login/login-by-code 1

...... 你的账号是已经登陆的情况下进入的这个页面吗?

是的,已登录界面获取的CK,,大佬给个联系方式吧,我加你

我的也是报302。。。应该是加入了什么验证,跟52pojie一样。以前用的好好的,现在一直302.

@2117516450
Copy link
Contributor Author

在模版里面自行测试一下,看看返回值
cookie目前很容易过期,大概最长一个星期时间

@icaca
Copy link

icaca commented Nov 11, 2024

这两天好像每天都要重新获取下cookies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants