Skip to content

Commit 53465e8

Browse files
committed
修复ipad签到报错的问题,需更新ck
1 parent b0759aa commit 53465e8

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

Task/weibo.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
更新时间: 2021-02-10 14:25
2+
更新时间: 2021-02-14 20:20
33
44
本脚本仅适用于微博每日签到,支持多账号运行
55
@@ -52,6 +52,9 @@ if ($.isNode()) {
5252
token = tokenArr[i];
5353
$.index = i + 1;
5454
console.log(`\n开始【微博签到${$.index}】`)
55+
if(token.indexOf("from")==-1){
56+
token += "from=10B2193010&"
57+
}
5558
await getsign();
5659
await doCard();
5760
await paysign()
@@ -66,7 +69,7 @@ if ($.isNode()) {
6669
function GetCookie() {
6770
if ($request && $request.method != 'OPTIONS' && $request.url.indexOf("gsid=") > -1) {
6871
const signurlVal = $request.url;
69-
let token = signurlVal.replace(/(.+)(uid=\d+)(.+)(&gsid=[_a-zA-Z0-9-]+)(&.+)(&s=\w+)/,'$2$4$6'),
72+
let token = signurlVal.replace(/(.+)(from=\w+)(.+)(&uid=\d+)(.+)(&gsid=[_a-zA-Z0-9-]+)(&.+)(&s=\w+)/,'$2$4$6$8'),
7073
uid = token.match(/uid=\d+/);
7174
if (wbtoken) {
7275
if (wbtoken.indexOf(uid) > -1) {
@@ -87,7 +90,7 @@ function GetCookie() {
8790
function getsign() {
8891
return new Promise((resolve, reject) =>{
8992
let signurl = {
90-
url: `https://api.weibo.cn/2/checkin/add?from=10B2193010&c=iphone&${token}`,
93+
url: `https://api.weibo.cn/2/checkin/add?c=iphone&${token}`,
9194
headers: {"User-Agent": `Weibo/52021 (iPhone; iOS 14.5; Scale/3.00)`}}
9295
$.get(signurl, async(error, resp, data) => {
9396
let result = JSON.parse(data)
@@ -115,7 +118,7 @@ function getsign() {
115118
function doCard() {
116119
return new Promise((resolve, reject) =>{
117120
let doCardurl = {
118-
url: `https://api.weibo.cn/2/!/ug/king_act_home?from=10B2193010&c=iphone&${token}`,
121+
url: `https://api.weibo.cn/2/!/ug/king_act_home?c=iphone&${token}`,
119122
headers: {"User-Agent": `Weibo/52021 (iPhone; iOS 14.5; Scale/3.00)`}}
120123
$.get(doCardurl, (error, resp, data) => {
121124
//$.log(data)

0 commit comments

Comments
 (0)