diff --git a/script/tieba/tieba_checkin.js b/script/tieba/tieba_checkin.js index f503a6b6d..f7fb1ec12 100644 --- a/script/tieba/tieba_checkin.js +++ b/script/tieba/tieba_checkin.js @@ -7,7 +7,8 @@ const batchSize = 20; const retries = 5; // 签到失败重试次数 const interval = 2000; // 每次重试间隔 const tiebaCookieKey = "tieba_checkin_cookie"; -const tiebeGetCookieRegex = /https?:\/\/c\.tieba\.baidu\.com\/c\/s\/login/; +const tiebeGetCookieRegex = /https?:\/\/(c\.tieba\.baidu\.com|180\.97\.\d+\.\d+)\/c\/s\/login/; +const tiebeNewVersionGetCookieRegex = /^https?:\/\/c\.tieba\.baidu\.com\/c\/s\/channelIconConfig/; let magicJS = MagicJS(scirptName, "INFO"); magicJS.unifiedPushUrl = magicJS.read("tieba_unified_push_url") || magicJS.read("magicjs_unified_push_url"); @@ -108,7 +109,7 @@ function TiebaCheckIn(cookie, tbs, tieba) { } (async () => { - if (magicJS.isRequest && tiebeGetCookieRegex.test(magicJS.request.url)) { + if (magicJS.isRequest && (tiebeGetCookieRegex.test(magicJS.request.url) || tiebeNewVersionGetCookieRegex.test(magicJS.request.url))) { let cookie = magicJS.request.headers.Cookie; let hisCookie = magicJS.read(tiebaCookieKey); magicJS.logDebug(`当前贴吧Cookie:\n${cookie}\n历史贴吧Cookie:\n${hisCookie}`); diff --git a/script/tieba/tieba_checkin.lnscript b/script/tieba/tieba_checkin.lnscript index 1707172a2..63702132b 100644 --- a/script/tieba/tieba_checkin.lnscript +++ b/script/tieba/tieba_checkin.lnscript @@ -1,6 +1,7 @@ # 百度贴吧签到 -http-request ^https?:\/\/c\.tieba\.baidu\.com\/c\/s\/login script-path=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/tieba/tieba_checkin.js,tag=贴吧_获取Cookie +http-request ^https?:\/\/(c\.tieba\.baidu\.com|180\.97\.\d+\.\d+)\/c\/s\/login script-path=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/tieba/tieba_checkin.js,tag=贴吧_获取Cookie +http-request ^https?:\/\/c\.tieba\.baidu\.com\/c\/s\/channelIconConfig script-path=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/tieba/tieba_checkin.js,tag=贴吧_获取新版Cookie cron "30 0 * * *" script-path=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/tieba/tieba_checkin.js,timeout=60,tag=贴吧_每日签到 hostname = c.tieba.baidu.com \ No newline at end of file diff --git a/script/tieba/tieba_checkin.qxrewrite b/script/tieba/tieba_checkin.qxrewrite index 71e6dbca5..a44a80777 100644 --- a/script/tieba/tieba_checkin.qxrewrite +++ b/script/tieba/tieba_checkin.qxrewrite @@ -1,5 +1,6 @@ # 百度贴吧每日自动签到 -^https?:\/\/c\.tieba\.baidu\.com\/c\/s\/login url script-request-header https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/tieba/tieba_checkin.js +^https?:\/\/(c\.tieba\.baidu\.com|180\.97\.\d+\.\d+)\/c\/s\/login url script-request-header https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/tieba/tieba_checkin.js +^https?:\/\/c\.tieba\.baidu\.com\/c\/s\/channelIconConfig url script-request-header https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/tieba/tieba_checkin.js hostname = c.tieba.baidu.com \ No newline at end of file diff --git a/script/tieba/tieba_checkin.sgmodule b/script/tieba/tieba_checkin.sgmodule index aece3b7f3..5d3f7d64b 100644 --- a/script/tieba/tieba_checkin.sgmodule +++ b/script/tieba/tieba_checkin.sgmodule @@ -4,7 +4,8 @@ [Script] 贴吧_每日签到 = type=cron,cronexp=30 0 * * *,timeout=60,script-path=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/tieba/tieba_checkin.js -贴吧_获取cookie = type=http-request,pattern=^https?:\/\/c\.tieba\.baidu\.com\/c\/s\/login,script-path=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/tieba/tieba_checkin.js +贴吧_获取cookie = type=http-request,pattern=^https?:\/\/(c\.tieba\.baidu\.com|180\.97\.\d+\.\d+)\/c\/s\/login,script-path=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/tieba/tieba_checkin.js +贴吧_获取新版cookie = type=http-request,pattern=^https?:\/\/c\.tieba\.baidu\.com\/c\/s\/channelIconConfig,script-path=https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/tieba/tieba_checkin.js [MITM] hostname = %APPEND% c.tieba.baidu.com \ No newline at end of file