├── README.md
├── .gitignore
├── Scripts
├── nga
│ ├── nga.png
│ ├── nga.task.png
│ ├── nga.cookie.qx.conf
│ ├── nga.redirect.qx.conf
│ ├── nga.cookie.sgmodule
│ ├── nga.redirect.sgmodule
│ ├── README.md
│ ├── nga.cookie.js
│ └── nga.js
├── bilibili
│ ├── b23.redirect.snippet
│ └── b23.redirect.sgmodule
├── bing
│ ├── bing.mobile.snippet
│ └── bing.mobile.sgmodule
├── weibo
│ ├── weibo.hot.js
│ ├── weibo.redirect.qx.conf
│ ├── weibo.redirect.sgmodule
│ ├── weibo.redirect.js
│ ├── weibotalk.cookie.js
│ ├── weibotalk.js
│ └── weibo.task.js
├── ithome
│ ├── ithome.cookie.qx.conf
│ ├── ithome.ad.qx.conf
│ ├── ithome.ad.sgmodule
│ ├── ithome.ad.js
│ └── ithome.task.js
├── xiaohongshu
│ └── xhslink.redirect.sgmodule
├── jike
│ ├── jike.live.js
│ ├── jike.qx.conf
│ └── jike.sgmodule
├── bika
│ ├── bika.ad.snippet
│ ├── bika.ad.js
│ └── bika.ad.sgmodule
└── qmkg
│ ├── qmkg.cookie.js
│ └── qmkg.js
├── IconSet
└── Color
│ └── Microsoft.png
├── Filters
├── Thunder.list
├── Bilibili.list
└── AppleProxy.list
└── vei.boxjs.json
/README.md:
--------------------------------------------------------------------------------
1 | # Deprecated
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .vscode
--------------------------------------------------------------------------------
/Scripts/nga/nga.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chouchoui/QuanX/HEAD/Scripts/nga/nga.png
--------------------------------------------------------------------------------
/Scripts/nga/nga.task.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chouchoui/QuanX/HEAD/Scripts/nga/nga.task.png
--------------------------------------------------------------------------------
/IconSet/Color/Microsoft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chouchoui/QuanX/HEAD/IconSet/Color/Microsoft.png
--------------------------------------------------------------------------------
/Scripts/bilibili/b23.redirect.snippet:
--------------------------------------------------------------------------------
1 | hostname = b23.tv
2 |
3 | ^https?:\/\/b23.tv url 302 https://b23.tf
--------------------------------------------------------------------------------
/Scripts/bing/bing.mobile.snippet:
--------------------------------------------------------------------------------
1 | hostname = www.bing.com
2 |
3 | ^https:\/\/www\.bing\.com\/(search|new) url request-header Gecko\) request-header Gecko) EdgiOS/110.0.1587.63
--------------------------------------------------------------------------------
/Scripts/nga/nga.cookie.qx.conf:
--------------------------------------------------------------------------------
1 | hostname = ngabbs.com
2 |
3 | ^https:\/\/ngabbs.com\/nuke.php\?? url script-request-body https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/nga/nga.cookie.js
--------------------------------------------------------------------------------
/Scripts/bilibili/b23.redirect.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=哔哩哔哩 b23 短链防追踪重定向
2 | #!desc=将 b23.tv 短链重定向至 b23.wtf 防止追踪参数
3 |
4 | [URL Rewrite]
5 | ^https?:\/\/b23.tv https://b23.tf 302
6 |
7 | [MITM]
8 | hostname = %APPEND% b23.tv
--------------------------------------------------------------------------------
/Filters/Thunder.list:
--------------------------------------------------------------------------------
1 | DOMAIN,down.sandai.net,DIRECT // 迅雷更新
2 | DOMAIN,hub5btmain.v6.shub.sandai.net,REJECT // 迅雷版权
3 | DOMAIN,hub5idx.v6.shub.sandai.net,REJECT // 迅雷版权
4 | DOMAIN,hub5emu.v6.shub.sandai.net,REJECT // 迅雷版权
--------------------------------------------------------------------------------
/Scripts/weibo/weibo.hot.js:
--------------------------------------------------------------------------------
1 | let body = JSON.parse($response.body);
2 |
3 | body.cards[0].card_group = body.cards[0].card_group.filter(c=>!c.itemid.includes("t:51"));
4 | body = JSON.stringify(body);
5 |
6 | $done({ body });
7 |
--------------------------------------------------------------------------------
/Scripts/ithome/ithome.cookie.qx.conf:
--------------------------------------------------------------------------------
1 | hostname = my.ruanmei.com
2 |
3 |
4 | ^https:\/\/my\.ruanmei\.com\/api\/usersign\/getsigninfo? url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/ithome/ithome.cookie.js
--------------------------------------------------------------------------------
/Scripts/xiaohongshu/xhslink.redirect.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=小红书 xhslink 短链防追踪重定向
2 | #!desc=将 xhslink.com 短链重定向至 xhslink.icu 防止追踪参数
3 |
4 | [URL Rewrite]
5 | ^https?:\/\/xhslink.com https://xhslink.icu 302
6 |
7 | [MITM]
8 | hostname = %APPEND% xhslink.com
--------------------------------------------------------------------------------
/Scripts/nga/nga.redirect.qx.conf:
--------------------------------------------------------------------------------
1 | hostname = bbs.nga.cn, nga.178.com
2 |
3 | # NGA重定向
4 | ^https?:\/\/bbs\.nga\.cn url 302 https://ngabbs.com
5 | ^https?:\/\/nga\.178\.com url 302 https://ngabbs.com
6 | ^http:\/\/ngabbs\.com url 302 https://ngabbs.com
7 |
--------------------------------------------------------------------------------
/Scripts/jike/jike.live.js:
--------------------------------------------------------------------------------
1 | let body = JSON.parse($response.body);
2 |
3 | if (/^https:\/\/api\.ruguoapp\.com\/1\.0\/recommendFeed\/list/.test($request.url)) {
4 | body.data = body.data.filter((d) => !d.live && !d.lives);
5 | body = JSON.stringify(body);
6 | }
7 |
8 | $done({ body });
9 |
--------------------------------------------------------------------------------
/Scripts/jike/jike.qx.conf:
--------------------------------------------------------------------------------
1 | hostname = 47.99.112.78, *.ruguoapp.com
2 |
3 | ^https:\/\/api\.ruguoapp\.com\/1\.0\/devices\/collect url reject
4 | ^https:\/\/api\.ruguoapp\.com\/1\.0\/recommendFeed\/list url script-response-body https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/jike/jike.live.js
--------------------------------------------------------------------------------
/Scripts/bing/bing.mobile.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=New Bing for iOS Safari
2 | #!desc=Bing的iOS Safari的UA改变为Edge移动版
3 | #!system=ios
4 |
5 | [Header Rewrite]
6 | ^https:\/\/www\.bing\.com\/(search|new) header-replace-regex User-Agent Gecko\) "Gecko) EdgiOS/110.0.1587.63"
7 |
8 | [MITM]
9 | hostname = %APPEND% www.bing.com
--------------------------------------------------------------------------------
/Scripts/nga/nga.cookie.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=NGA刮墙获取Cookie
2 | #!desc=NGA APP 刮墙签到获取响应头相关信息
3 |
4 | [Script]
5 | NGA刮墙获取Cookie = type=http-request, pattern=^https:\/\/ngabbs.com\/nuke.php\??, requires-body=1, max-size=0, script-path=https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/nga/nga.cookie.js
6 |
7 | [MITM]
8 | hostname = %APPEND% ngabbs.com
--------------------------------------------------------------------------------
/Scripts/nga/nga.redirect.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=NGA 重定向
2 | #!desc=将多个NGA域名重定向至同一个域名
3 |
4 | [URL Rewrite]
5 | ^https?:\/\/bbs\.nga\.cn https://ngabbs.com 302
6 | ^https?:\/\/g\.nga\.cn https://ngabbs.com 302
7 | ^https?:\/\/nga\.178\.com https://ngabbs.com 302
8 | ^http:\/\/ngabbs\.com https://ngabbs.com 302
9 |
10 | [MITM]
11 | hostname = %APPEND% nga.178.com, bbs.nga.cn, g.nga.cn
--------------------------------------------------------------------------------
/Scripts/bika/bika.ad.snippet:
--------------------------------------------------------------------------------
1 | ;请自行在AdGuard等广告屏蔽软件/内容拦截器里添加以下规则
2 | ;manhuabika.com###homecontentbox
3 | ;manhuabika.com##.catListview>a
4 |
5 | hostname=*manhuabika.com
6 |
7 | ^https:\/\/manhuabika\.com\/ad url reject-array
8 | https:\/\/api\.manhuabika\.com\/announcements url script-response-body https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/bika/bika.ad.js
9 |
10 |
--------------------------------------------------------------------------------
/Scripts/jike/jike.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=即刻
2 | #!desc=移除即刻APP动态广场中直播动态
3 |
4 | [Rule]
5 | IP-CIDR,203.107.1.1/24,REJECT,no-resolve
6 |
7 | [URL Rewrite]
8 | ^https:\/\/api\.ruguoapp\.com\/1\.0\/devices\/collect - reject
9 |
10 | [Script]
11 | 即刻移除直播 = type=http-response, pattern=^https:\/\/api\.ruguoapp\.com\/1\.0\/recommendFeed\/list, requires-body=1, max-size=0, script-path=https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/jike/jike.live.js
12 |
13 | [MITM]
14 | hostname=%APPEND% 47.99.112.78, api.ruguoapp.com
15 |
--------------------------------------------------------------------------------
/Scripts/bika/bika.ad.js:
--------------------------------------------------------------------------------
1 | /*
2 | 请自行在AdGuard等广告屏蔽软件/内容拦截器里添加以下规则
3 | manhuabika.com###homecontentbox
4 | manhuabika.com##.catListview>a
5 | */
6 |
7 | const reg1 = /https:\/\/api\.manhuabika\.com\/announcements/;
8 |
9 | let body = {};
10 |
11 | if (reg1.test($request.url)) {
12 | if ($response.body) {
13 | console.log($response.body);
14 | body = JSON.parse($response.body);
15 | body.data.announcements.docs = [];
16 | body.data.announcements.total = 0;
17 | $done({
18 | body: JSON.stringify(body),
19 | });
20 | } else {
21 | $done({});
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Scripts/weibo/weibo.redirect.qx.conf:
--------------------------------------------------------------------------------
1 | hostname = share.api.weibo.cn, weibointl.api.weibo.cn, weibointl.api.weibo.com, weibo.cn
2 |
3 | // 微博国际版跳转到微博客户端
4 | ^https?:\/\/(share|weibointl)\.api\.weibo\.(cn|com)\/(share|portal)(.*)weibo_id=(.*) url 302 https://m.weibo.cn/status/$5
5 |
6 | // 微博拦截链接跳转浏览器
7 | ^https:\/\/weibo\.cn\/sinaurl\?toasturl=(.*) url script-request-header https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/weibo/weibo.redirect.js
8 |
9 | // 微博国际版链接跳转
10 | ^https?:\/\/(share|weibointl)\.api\.weibo\.(cn|com)\/share\/(.*).html url script-response-body https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/weibo/weibo.redirect.js
--------------------------------------------------------------------------------
/Filters/Bilibili.list:
--------------------------------------------------------------------------------
1 | HOST-SUFFIX,acgvideo.com,Bilibili
2 | HOST-SUFFIX,bilibili.com,Bilibili
3 | HOST-SUFFIX,hdslb.com,Bilibili
4 | HOST-SUFFIX,biliapi.net,Bilibili
5 | USER-AGENT,bili*,Bilibili
6 | USER-AGENT,Bilibili*,Bilibili
7 | HOST-SUFFIX,acg.tv,Bilibili
8 | HOST-SUFFIX,acgvideo.com,Bilibili
9 | HOST-SUFFIX,b23.tv,Bilibili
10 | HOST-SUFFIX,biliapi.com,Bilibili
11 | HOST-SUFFIX,biliapi.net,Bilibili
12 | HOST-SUFFIX,bilibili.com,Bilibili
13 | HOST-SUFFIX,biligame.com,Bilibili
14 | HOST-SUFFIX,biligame.net,Bilibili
15 | HOST-SUFFIX,bilivideo.com,Bilibili
16 | HOST-SUFFIX,hdslb.com,Bilibili
17 | HOST-SUFFIX,im9.com,Bilibili
18 | HOST-SUFFIX,smtcdns.net,Bilibili
19 | DOMAIN,upos-hz-mirrorakam.akamaized.net,Bilibili
20 |
--------------------------------------------------------------------------------
/Scripts/bika/bika.ad.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=哔咔去广告
2 | #!desc=哔咔网页版去广告
3 |
4 |
5 | [URL Rewrite]
6 | ;"https:\/\/manhuabika\.com\/wp-content\/themes\/pic-pwa-pic\/comic\/assets\/js\/page-pcomic-home\.js" - reject
7 | ;请自行在AdGuard等广告屏蔽软件/内容拦截器里添加以下规则
8 | ;manhuabika.com###homecontentbox
9 | ;manhuabika.com##.catListview>a
10 | [Map Local]
11 | "^https:\/\/manhuabika\.com\/ad" data="https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/blank/blank_array.json"
12 | [Script]
13 | 哔咔去广告 = type=http-response,pattern=^https:\/\/api\.manhuabika\.com\/announcements,requires-body=1,max-size=-1,debug=1,script-path=https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/bika/bika.ad.js
14 |
15 | [MITM]
16 | hostname = %APPEND% *manhuabika.com
--------------------------------------------------------------------------------
/Scripts/ithome/ithome.ad.qx.conf:
--------------------------------------------------------------------------------
1 | hostname = m.ithome.com, api.ithome.com, api.zuihuimai.com, napi.ithome.com
2 |
3 | # IT之家移动Web与APP新闻列表广告
4 | ^https:\/\/m\.ithome\.com\/api\/news\/newslistpageget url script-response-body https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/ithome/ithome.ad.js
5 | ^https:\/\/api\.ithome\.com\/json\/(listpage|newslist)\/news url script-response-body https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/ithome/ithome.ad.js
6 | ^https:\/\/api\.ithome\.com\/json\/slide\/index url script-response-body https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/ithome/ithome.ad.js
7 | ^https:\/\/api\.zuihuimai\.com url reject
8 | ^https:\/\/napi\.ithome\.com\/api\/(news|topmenu)\/(getfeeds|index) url script-response-body https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/ithome/ithome.ad.js
--------------------------------------------------------------------------------
/Filters/AppleProxy.list:
--------------------------------------------------------------------------------
1 | DOMAIN,api-glb-sea.smoot.apple.com
2 | DOMAIN,books.itunes.apple.com
3 | DOMAIN,cvws.icloud-content.com
4 | DOMAIN,developer.apple.com
5 | DOMAIN,hls.itunes.apple.com
6 | DOMAIN,itunes.apple.com
7 | DOMAIN,lookup-api.apple.com
8 | DOMAIN,buy.itunes.apple.com
9 | DOMAIN,sandbox.itunes.apple.com
10 | DOMAIN,testflight.apple.com
11 | DOMAIN-SUFFIX,apple-dns.net
12 | DOMAIN-SUFFIX,apps.apple.com
13 | DOMAIN-SUFFIX,appsto.re
14 | DOMAIN-SUFFIX,blobstore.apple.com
15 | DOMAIN-SUFFIX,itsliveradio.apple.com
16 | DOMAIN-SUFFIX,aodp-ssl.apple.com
17 | DOMAIN-SUFFIX,video-ssl.itunes.apple.com
18 | DOMAIN-SUFFIX,mvod.itunes.apple.com
19 | DOMAIN-SUFFIX,hls-amt.itunes.apple.com
20 | DOMAIN-SUFFIX,audio-ssl.itunes.apple.com
21 | DOMAIN-SUFFIX,streamingaudio.itunes.apple.com
22 | DOMAIN-SUFFIX,amazonaws.com
23 | DOMAIN-SUFFIX,audio.itunes.apple.com
24 | DOMAIN-SUFFIX,digicert.com
25 | USER-AGENT,com.apple.trustd*
26 |
--------------------------------------------------------------------------------
/Scripts/weibo/weibo.redirect.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=微博跳转
2 | #!desc=将微博国际版链接跳转到官方微博,将微博拦截链接跳转至Safari
3 | #!author=chouchoui
4 |
5 |
6 | [URL Rewrite]
7 | ^https?:\/\/(share|weibointl)\.api\.weibo\.(cn|com)\/(share|portal)(.*)weibo_id=(.*) https://m.weibo.cn/status/$5 302
8 |
9 | [Script]
10 | # 微博国际版链接跳转 = type=http-request,pattern=^https?:\/\/(share|weibointl)\.api\.weibo\.(cn|com)\/(share|portal)(.*)weibo_id=(.*),script-path=https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/weibo/weibo.redirect.js,script-update-interval=0
11 | 微博拦截链接跳转 = type=http-request,pattern=^https:\/\/weibo\.cn\/sinaurl\?toasturl=(.*),script-path=https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/weibo/weibo.redirect.js,script-update-interval=0
12 | 微博国际版链接跳转 = type=http-response,pattern=^https?:\/\/(share|weibointl)\.api\.weibo\.(cn|com)\/share\/(.*).html,requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/weibo/weibo.redirect.js,script-update-interval=0
13 |
14 |
15 |
16 | [MITM]
17 | hostname = %APPEND% share.api.weibo.cn, weibointl.api.weibo.cn, weibointl.api.weibo.com, weibo.cn
--------------------------------------------------------------------------------
/Scripts/ithome/ithome.ad.sgmodule:
--------------------------------------------------------------------------------
1 | #!name=IT之家去广告
2 | #!desc=移除IT之家移动页面分页后广告,APP新闻列表广告
3 | #!author=chouchoui
4 |
5 | [URL Rewrite]
6 | ^https:\/\/api\.zuihuimai\.com - reject
7 |
8 | [Script]
9 | IT之家手机页面去广告 = type=http-response,pattern=^https:\/\/m\.ithome\.com\/api\/news\/newslistpageget,requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/ithome/ithome.ad.js,script-update-interval=0
10 | IT之家APP新闻列表去广告 = type=http-response,requires-body=1,max-size=0,pattern=^https:\/\/api\.ithome\.com\/json\/(listpage|newslist)\/news,script-path=https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/ithome/ithome.ad.js,script-update-interval=0
11 | IT之家APP首页轮播图去广告 = type=http-response,requires-body=1,max-size=0,pattern=^https:\/\/api\.ithome\.com\/json\/slide\/index,script-path=https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/ithome/ithome.ad.js,script-update-interval=0
12 | IT之家APP列表新接口 = type=http-response,requires-body=1,max-size=0,pattern=^https:\/\/napi\.ithome\.com\/api\/(news|topmenu)\/(getfeeds|index),script-path=https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/ithome/ithome.ad.js,script-update-interval=0
13 |
14 | [MITM]
15 | hostname = %APPEND% m.ithome.com, api.ithome.com, api.zuihuimai.com, napi.ithome.com
--------------------------------------------------------------------------------
/Scripts/nga/README.md:
--------------------------------------------------------------------------------
1 | # NGA刮墙
2 |
3 | ## QuanX配置
4 | ```properties
5 | [MITM]
6 | ngabbs.com
7 |
8 | [rewrite_local]
9 | ^https:\/\/ngabbs.com\/nuke.php\?? url script-request-body https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/nga/nga.cookie.js
10 |
11 |
12 | [task_local]
13 | 10 0 * * * https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/nga/nga.js, tag=NGA刮墙, enabled=true, img-url=https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/nga/nga.png
14 | ```
15 |
16 | ## 说明
17 |
18 | 1. 将`ngabbs.com`添加MitM
19 | 2. 添加重写
20 | - 重写-添加
21 | - 类型 `script-request-body`
22 | - 用以匹配的URL
23 | `^https:\/\/ngabbs.com\/nuke.php\?? url script-request-body`
24 | - 脚本路径
25 | `https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/nga/nga.cookie.js`
26 | - 重写-搜索-搜索ngabbs-点击右侧三点-更新脚本
27 | 3. 添加定时Task
28 | - 标签 `NGA刮墙`
29 | - Cron 表达式 `10 0 * * *`
30 | - 脚本路径
31 | `https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/nga/nga.js`
32 | - 图标
33 | 白色图标 `https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/nga/nga.png`
34 | 彩色图标 `https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/nga/nga.task.png`
35 | - 请求列表中点击`NGA刮墙`-更新脚本
36 | 4. 杀掉NGA后台并重新打开NGA,提示Cookie获取成功
37 | 5. 禁用Cookie获取重写
38 |
--------------------------------------------------------------------------------
/Scripts/ithome/ithome.ad.js:
--------------------------------------------------------------------------------
1 | const mobileWebRegex = /^https:\/\/m\.ithome\.com\/api\/news\/newslistpageget/;
2 | const appRegex = /^https:\/\/api\.ithome\.com\/json\/(listpage|newslist)\/news/;
3 | const appSlideRegex = /^https:\/\/api\.ithome\.com\/json\/slide\/index/;
4 | const newAppFeed = /^https:\/\/napi\.ithome\.com\/api\/(news|topmenu)\/(getfeeds|index)/;
5 |
6 | let body = JSON.parse($response.body);
7 |
8 | if (mobileWebRegex.test($request.url)) {
9 | body.Result = body.Result.filter((r) => r.NewsTips.every((t) => t.TipName !== "广告"));
10 | } else if (appRegex.test($request.url)) {
11 | body.newslist = body.newslist.filter((n) => !n.aid);
12 | } else if (appSlideRegex.test($request.url)) {
13 | const newList = body.filter((i) => !i.isad);
14 | body.splice(0, body.length);
15 | body.push(...newList);
16 | } else if (newAppFeed.test($request.url)) {
17 | let list = body.data.list;
18 | const newList = [];
19 | for (const item of list) {
20 | if (item.feedContent.smallTags && item.feedContent.smallTags.some((s) => s.text === "广告")) {
21 | continue;
22 | }
23 | if (item.feedContent.focusNewsData) {
24 | const newNewsData = item.feedContent.focusNewsData.filter((n) => !n.isAd);
25 | item.feedContent.focusNewsData = newNewsData;
26 | }
27 | newList.push(item);
28 | }
29 | body.data.list = newList;
30 | }
31 |
32 | body = JSON.stringify(body);
33 | $done({ body });
34 |
--------------------------------------------------------------------------------
/vei.boxjs.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "vei.app.sub",
3 | "name": "chouchoui 应用订阅",
4 | "author": "@chouchoui",
5 | "icon": "https://avatars3.githubusercontent.com/u/14866249?s=460&u=40faa1309b2303e1a3d9cec8f57f05c7005256de&v=4",
6 | "repo": "https://github.com/chouchoui/QuanX",
7 | "apps": [
8 | {
9 | "id": "vei.nga",
10 | "name": "NGA",
11 | "keys": ["vei_nga_cookie", "vei_nga_content_type", "vei_nga_user_agent", "vei_nga_mission", "vei_nga_body"],
12 | "author": "@chouchoui",
13 | "repo": "https://github.com/chouchoui/QuanX/tree/master/Scripts/nga",
14 | "icons": ["https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/nga/nga.png", "https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/nga/nga.task.png"],
15 | "script": "https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/nga/nga.js"
16 | },
17 | {
18 | "id": "vei.qmkg",
19 | "name": "全民K歌",
20 | "keys": ["vei_qmkg_url", "vei_qmkg_headers", "vei_qmkg_body"],
21 | "author": "@GideonSenku, @chouchoui",
22 | "repo": "https://github.com/chouchoui/QuanX/tree/master/Scripts/qmkg",
23 | "icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/Alpha/qmkg.png", "https://raw.githubusercontent.com/Orz-3/mini/master/Color/qmkg.png"],
24 | "script": "https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/qmkg/qmkg.js"
25 | }
26 | ]
27 | }
28 |
--------------------------------------------------------------------------------
/Scripts/weibo/weibo.redirect.js:
--------------------------------------------------------------------------------
1 | const regexShare = /^https?:\/\/(share|weibointl)\.api\.weibo\.(cn|com)\/(share|portal)(.*)weibo_id=(.*)/;
2 | const regexToast = /^https:\/\/weibo\.cn\/sinaurl\?toasturl=(.*)/;
3 | const regexShareHtml = /^https?:\/\/(share|weibointl)\.api\.weibo\.(cn|com)\/share\/(.*).html/;
4 |
5 | const url = $request.url;
6 |
7 | const $ = new helper();
8 |
9 | const redirectHtml = (url) => `
10 |
11 |
12 |
13 |
14 |
15 | Document
16 |
17 |
18 |
21 |
22 |
23 | `;
24 |
25 | let resultUrl = "";
26 |
27 | if (regexShareHtml.test(url)) {
28 | if ($response) {
29 | const body = $response.body;
30 | let match = [];
31 | const reg1 = /onclick="serach\((?.*),(.*),(.*)\)"/;
32 | const reg2 = /onclick="forward\(0,(?.*),(.*)\)"/;
33 |
34 | if (reg1.test(body)) {
35 | match = reg1.exec(body);
36 | } else if (reg2.test(body)) {
37 | match = reg2.exec(body);
38 | } else {
39 | console.log(body);
40 | $.notify(`微博重定向错误`, "", "未找到weiboId");
41 | $done({});
42 | }
43 | if (match && match.length > 0) {
44 | const weiboId = match.groups.weiboId;
45 | resultUrl = `https://m.weibo.cn/status/${weiboId}`;
46 | }
47 | }
48 | } else if (regexToast.test(url)) {
49 | if (["&gsid=", "&toastflag="].every((r) => !url.includes(r))) {
50 | resultUrl = getParameterByName(url, "toasturl");
51 | }
52 | } else if (regexShare.test(url)) {
53 | const matchs = url.match(regexShare);
54 | const weiboId = matchs[5];
55 | resultUrl = `https://m.weibo.cn/status/${weiboId}`;
56 | }
57 |
58 | if (resultUrl) {
59 | $.notify(`🔗点击打开微博`, "", resultUrl, resultUrl);
60 | $done({ body: redirectHtml(resultUrl) });
61 | }
62 |
63 | function getParameterByName(params, name) {
64 | var match = RegExp("[?&]" + name + "=([^&]*)").exec(params);
65 | return match && decodeURIComponent(match[1].replace(/\+/g, " "));
66 | }
67 |
68 | function helper() {
69 | const isQuanX = typeof $task != "undefined";
70 | const isLoon = typeof $loon != "undefined";
71 | const isSurge = typeof $httpClient != "undefined" && !isLoon;
72 | this.notify = (title, subtitle, message, url) => {
73 | if (isLoon) $notification.post(title, subtitle, message, url);
74 | if (isQuanX) $notify(title, subtitle, message, { "open-url": url, "update-pasteboard": url });
75 | if (isSurge) $notification.post(title, subtitle, message, { url: url });
76 | };
77 | this.get = (url, cb) => {
78 | if (isSurge) {
79 | $httpClient.get(url, cb);
80 | }
81 | if (isQuanX) {
82 | url.method = "GET";
83 | $task.fetch(url).then((resp) => cb(null, resp, resp.body));
84 | }
85 | };
86 | }
87 |
--------------------------------------------------------------------------------
/Scripts/qmkg/qmkg.cookie.js:
--------------------------------------------------------------------------------
1 | const $vei = init();
2 | $vei.url = "vei_qmkg_url"
3 | $vei.headers = "vei_qmkg_headers";
4 | $vei.body = "vei_qmkg_body";
5 |
6 | function getParameterByName(params, name) {
7 | var match = RegExp('[?&]' + name + '=([^&]*)').exec(params);
8 | return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
9 | }
10 |
11 | function getUidFromCookie(cookie) {
12 | const array = cookie.split("; ")
13 | let uid = ''
14 | for (const item of array) {
15 | if (item.indexOf('uid=') >= 0) {
16 | uid = item.split('=')[1]
17 | }
18 | }
19 | return uid
20 | }
21 |
22 | try {
23 | const url = $request.url;
24 | $vei.write(url, $vei.url);
25 | const headers = JSON.stringify($request.headers);
26 | $vei.write(headers, $vei.headers);
27 |
28 | const openkey = getParameterByName(url, "g_tk_openkey")
29 | const uid = getUidFromCookie($request.headers.Cookie);
30 |
31 | const body = {
32 | "g_tk_openkey": openkey,
33 | "t_uid": uid,
34 | "t_show_entry": 0,
35 | "t_mapExtInfo": {
36 | "device_id": ""
37 | },
38 | "t_vctAppId": [
39 |
40 | ],
41 | "ns": "KG_TASK",
42 | "cmd": "task.revisionSignInGetAward",
43 | "ns_inbuf": "",
44 | "mapExt": {
45 | "file": "taskJce",
46 | "cmdName": "GetSignInAwardReq",
47 | "l5api": {
48 | "modid": 503937,
49 | "cmd": 589824
50 | },
51 | "l5api_exp1": {
52 | "modid": 817089,
53 | "cmd": 3801088
54 | }
55 | }
56 | }
57 | $vei.write(JSON.stringify(body), $vei.body);
58 | $vei.notify("全民K歌", "Cookie", "Cookie获取成功")
59 | } catch (error) {
60 | console.log(error)
61 | $vei.notify("全民K歌", "Cookie获取失败", "请查看日志")
62 | }
63 |
64 | function init() {
65 | const isRequest = typeof $request != "undefined"
66 | const isSurge = typeof $httpClient != "undefined"
67 | const isQuanX = typeof $task != "undefined"
68 | const notify = (title, subtitle, message) => {
69 | if (isQuanX) $notify(title, subtitle, message)
70 | if (isSurge) $notification.post(title, subtitle, message)
71 | }
72 | const write = (value, key) => {
73 | if (isQuanX) return $prefs.setValueForKey(value, key)
74 | if (isSurge) return $persistentStore.write(value, key)
75 | }
76 | const read = (key) => {
77 | if (isQuanX) return $prefs.valueForKey(key)
78 | if (isSurge) return $persistentStore.read(key)
79 | }
80 | const post = (options, callback) => {
81 | if (isQuanX) {
82 | if (typeof options == "string") options = { url: options }
83 | options["method"] = "POST"
84 | $task.fetch(options).then(response => {
85 | response["status"] = response.statusCode
86 | callback(null, response, response.body)
87 | }, reason => callback(reason.error, null, null))
88 | }
89 | if (isSurge) $httpClient.post(options, callback)
90 | }
91 | const end = () => {
92 | if (isQuanX) isRequest ? $done({}) : ""
93 | if (isSurge) isRequest ? $done({}) : $done()
94 | }
95 | return { isRequest, isQuanX, isSurge, notify, write, read, post, end }
96 | }
97 |
98 |
99 | $done({});
100 |
--------------------------------------------------------------------------------
/Scripts/weibo/weibotalk.cookie.js:
--------------------------------------------------------------------------------
1 | /**********
2 | 🐬作者
3 | @Evilbutcher。 https://github.com/evilbutcher
4 | @toulanboy。https://github.com/toulanboy/scripts
5 |
6 | 📌不定期更新各种签到、有趣的脚本,欢迎star🌟
7 |
8 | ***********************************
9 | 【配置步骤,请认真阅读,每一个细节都很重要】
10 | ***********************************
11 | 1. 根据你当前的软件,配置好srcipt。由于是远程文件,记得顺便更新文件。
12 | 2. 打开微博APP --> 底部栏“我的“ --> 中间的”超话社区“ --> 底部栏"我的" --> ”关注“, 弹出通知,提示获取已关注超话链接成功。
13 | 3. 点进一个超话页面,手动签到一次。弹出通知,提示获取超话签到链接成功。 若之前所有已经签到,请关注一个新超话进行签到。
14 | 4. 回到quanx等软件,关掉获取cookie的rewrite。(loon是关掉获取cookie的脚本)
15 |
16 | 📌 配置第2个账号方法:第1个账号获取cookie结束后。在微博app中切换到第2个号,进行相同的获取逻辑。
17 |
18 | ***************************************
19 | 【boxjs 订阅, 用于修改脚本配置】
20 | ***************************************
21 | box订阅链接:https://raw.githubusercontent.com/toulanboy/scripts/master/toulanboy.boxjs.json
22 | 订阅后,可以在box里面进行 cookie清空、通知个数、签到延迟 等设置.
23 |
24 | *************************
25 | 【Surge 4.2+ 脚本配置】
26 | *************************
27 | 微博超话cookie获取 = type=http-request,pattern=^https?://m?api\.weibo\.c(n|om)\/2\/(cardlist|page\/button),script-path=https://raw.githubusercontent.com/toulanboy/scripts/master/weibo/weibotalk.cookie.js
28 | 微博超话 = type=cron,cronexp="5 0 * * *",script-path=https://raw.githubusercontent.com/toulanboy/scripts/master/weibo/weibotalk.js,wake-system=true,timeout=600
29 |
30 | *************************
31 | 【Loon 2.1+ 脚本配置】
32 | *************************
33 | [script]
34 | cron "5 0 * * *" script-path=https://raw.githubusercontent.com/toulanboy/scripts/master/weibo/weibotalk.js, timeout=600, tag=微博超话
35 | http-request ^https?://m?api\.weibo\.c(n|om)\/2\/(cardlist|page\/button) script-path=https://raw.githubusercontent.com/toulanboy/scripts/master/weibo/weibotalk.cookie.js,requires-body=false, tag=微博超话cookie获取
36 |
37 | *************************
38 | 【 QX 1.0.10+ 脚本配置 】
39 | *************************
40 | [rewrite_local]
41 | ^https?://m?api\.weibo\.c(n|om)\/2\/(cardlist|page\/button) url script-request-header https://raw.githubusercontent.com/toulanboy/scripts/master/weibo/weibotalk.cookie.js
42 | [task]
43 | 5 0 * * * https://raw.githubusercontent.com/toulanboy/scripts/master/weibo/weibotalk.js, tag=微博超话
44 |
45 |
46 | [MITM]
47 | hostname = api.weibo.cn
48 |
49 | *********/
50 | $ = new Env("微博超话")
51 | //账号1
52 | const tokenurl = 'evil_tokenurl';
53 | const tokencheckinurl = 'evil_tokencheckinurl'
54 | const tokenheaders = 'evil_tokenheaders'
55 | const tokencheckinheaders = 'evil_tokencheckinheaders'
56 | //账号2
57 | const tokenurl2 = 'evil_tokenurl2';
58 | const tokencheckinurl2 = 'evil_tokencheckinurl2'
59 | const tokenheaders2= 'evil_tokenheaders2'
60 | const tokencheckinheaders2 = 'evil_tokencheckinheaders2'
61 |
62 | if ($request && $request.method != 'OPTIONS' && $request.url.match(/super_topic_followed/) && $request.url.match(/cardlist/)){
63 | const listurl = $request.url
64 | const listheaders = JSON.stringify($request.headers)
65 | if ($.getdata(tokenurl) == undefined || $.getdata(tokenurl) == "") {
66 | console.log(listurl)
67 | $.setdata(listurl, tokenurl)
68 | $.setdata(listheaders, tokenheaders)
69 | $.msg("微博超话 [账号一]", "✅获取已关注超话列表成功", "✨接下来,请点进一个超话进行签到\n如果没有签到的超话,请关注新的进行签到。")
70 | }
71 | else {
72 | if (!($.getdata(tokencheckinurl) == undefined || $.getdata(tokencheckinurl) == "") && listurl != $.getdata(tokenurl)) {
73 | console.log(listurl)
74 | $.setdata(listurl, tokenurl2)
75 | $.setdata(listheaders, tokenheaders2)
76 | $.msg("微博超话 [账号二]", "✅获取已关注超话列表成功", "✨接下来,请点进一个超话进行签到\n如果没有签到的超话,请关注新的进行签到。")
77 | }
78 | }
79 | } else if ($request && $request.method != 'OPTIONS' && $request.url.match(/super_topic_followed/) && $request.url.match(/page\/button/)){
80 | const checkinurl = $request.url
81 |
82 | const checkinheaders = JSON.stringify($request.headers)
83 | if (($.getdata(tokenurl) != undefined && $.getdata(tokenurl) != "") && ($.getdata(tokencheckinurl) == undefined || $.getdata(tokencheckinurl) == "")) {
84 | console.log(checkinurl)
85 | $.setdata(checkinurl, tokencheckinurl)
86 | $.setdata(checkinheaders, tokencheckinheaders)
87 | $.msg("微博超话 [账号一]", "🎉获取超话签到链接成功", `若之前已弹出【获取已关注列表成功】的通知,那么已完成当前账号cookie获取。\n🚨若你只需要签到1个账号,请现在去关闭获取cookie的脚本或重写。`)
88 |
89 | }
90 | else {
91 | if (!($.getdata(tokenurl2) == undefined || $.getdata(tokenurl2) == "")) {
92 | console.log(checkinurl)
93 | $.setdata(checkinurl, tokencheckinurl2)
94 | $.setdata(checkinheaders, tokencheckinheaders2)
95 | $.msg("微博超话 [账号二]", "🎉获取超话签到链接成功", `若之前已弹出【获取已关注列表成功】的通知,那么已完成当前账号cookie获取。\n🚨请关闭获取cookie的脚本或重写,然后可以愉快使用了。`)
96 | }
97 | }
98 | }
99 |
100 | $.done()
101 |
102 | //@Chavy
103 | function Env(s) {
104 | this.name = s, this.data = null, this.logs = [], this.isSurge = (() => "undefined" != typeof $httpClient), this.isQuanX = (() => "undefined" != typeof $task), this.isNode = (() => "undefined" != typeof module && !!module.exports), this.log = ((...s) => {
105 | this.logs = [...this.logs, ...s], s ? console.log(s.join("\n")) : console.log(this.logs.join("\n"))
106 | }), this.msg = ((s = this.name, t = "", i = "") => {
107 | this.isSurge() && $notification.post(s, t, i), this.isQuanX() && $notify(s, t, i);
108 | const e = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];
109 | s && e.push(s), t && e.push(t), i && e.push(i), console.log(e.join("\n"))
110 | }), this.getdata = (s => {
111 | if (this.isSurge()) return $persistentStore.read(s);
112 | if (this.isQuanX()) return $prefs.valueForKey(s);
113 | if (this.isNode()) {
114 | const t = "box.dat";
115 | return this.fs = this.fs ? this.fs : require("fs"), this.fs.existsSync(t) ? (this.data = JSON.parse(this.fs.readFileSync(t)), this.data[s]) : null
116 | }
117 | }), this.setdata = ((s, t) => {
118 | if (this.isSurge()) return $persistentStore.write(s, t);
119 | if (this.isQuanX()) return $prefs.setValueForKey(s, t);
120 | if (this.isNode()) {
121 | const i = "box.dat";
122 | return this.fs = this.fs ? this.fs : require("fs"), !!this.fs.existsSync(i) && (this.data = JSON.parse(this.fs.readFileSync(i)), this.data[t] = s, this.fs.writeFileSync(i, JSON.stringify(this.data)), !0)
123 | }
124 | }), this.wait = ((s, t = s) => i => setTimeout(() => i(), Math.floor(Math.random() * (t - s + 1) + s))), this.get = ((s, t) => this.send(s, "GET", t)), this.post = ((s, t) => this.send(s, "POST", t)), this.send = ((s, t, i) => {
125 | if (this.isSurge()) {
126 | const e = "POST" == t ? $httpClient.post : $httpClient.get;
127 | e(s, (s, t, e) => {
128 | t && (t.body = e, t.statusCode = t.status), i(s, t, e)
129 | })
130 | }
131 | this.isQuanX() && (s.method = t, $task.fetch(s).then(s => {
132 | s.status = s.statusCode, i(null, s, s.body)
133 | }, s => i(s.error, s, s))), this.isNode() && (this.request = this.request ? this.request : require("request"), s.method = t, s.gzip = !0, this.request(s, (s, t, e) => {
134 | t && (t.status = t.statusCode), i(null, t, e)
135 | }))
136 | }), this.done = ((s = {}) => this.isNode() ? null : $done(s))
137 | }
138 |
--------------------------------------------------------------------------------
/Scripts/qmkg/qmkg.js:
--------------------------------------------------------------------------------
1 | const $ = new Env("全民K歌");
2 | $.url = "vei_qmkg_url";
3 | $.headers = "vei_qmkg_headers";
4 | $.body = "vei_qmkg_body";
5 |
6 | const $url = $.getdata($.url);
7 | const $headers = JSON.parse($.getdata($.headers));
8 | const $body = $.getdata($.body);
9 |
10 | const headers = {
11 | "Accept-Encoding": $headers["Accept-Encoding"],
12 | Cookie: $headers["Cookie"],
13 | "Content-Type": $headers["Content-Type"],
14 | Referer: $headers["Referer"],
15 | Host: $headers["Host"],
16 | "User-Agent": $headers["User-Agent"],
17 | "No-Chunked": $headers["No-Chunked"],
18 | "Accept-Language": $headers["Accept-Language"],
19 | Connection: $headers["Connection"],
20 | };
21 |
22 | !(async () => {
23 | await sign();
24 | })()
25 | .catch((e) => $.logErr(e))
26 | .finally(() => $.done());
27 |
28 | function sign() {
29 | const options = { url: $url, headers: headers, body: $body };
30 |
31 | const promise = new Promise((resolve) => {
32 | $.post(options, (error, resp, data) => {
33 | try {
34 | if (error) {
35 | $.logErr(error, resp);
36 | $.msg($.name, "签到结果: 失败", error);
37 | } else if (resp.status === 200) {
38 | const result = JSON.parse(data);
39 | const total = result.data["task.revisionSignInGetAward"].total;
40 | const ret = result.data["task.revisionSignInGetAward"].ret;
41 | let subTitle = ``;
42 | let detail = ``;
43 | if (total != 0) {
44 | const num =
45 | result.data["task.revisionSignInGetAward"].awards[0].num;
46 | subTitle = `签到结果: 成功`;
47 | detail = `获得鲜花: ${num}朵,已连续签到:${total}天`;
48 | } else if (ret == -11532) {
49 | subTitle = `签到结果: 成功 (重复签到)`;
50 | } else {
51 | subTitle = `签到结果: 失败`;
52 | }
53 | $.msg($.name, subTitle, detail);
54 | }
55 | } catch (error) {
56 | $.logErr(error, resp);
57 | } finally {
58 | resolve();
59 | }
60 | });
61 | });
62 | return promise;
63 | }
64 |
65 | /***************** Env *****************/
66 | // prettier-ignore
67 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,resp:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,resp:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)}
68 |
--------------------------------------------------------------------------------
/Scripts/nga/nga.cookie.js:
--------------------------------------------------------------------------------
1 | /*
2 | ^https:\/\/ngabbs.com\/nuke.php\?? url script-response-body https://raw.githubusercontent.com/chouchoui/QuanX/master/Scripts/nga/nga.cookie.js
3 | */
4 |
5 | const $ = new Env("NGA刮墙");
6 | $.cookie = "vei_nga_cookie";
7 | $.contentType = "vei_nga_content_type";
8 | $.userAgent = "vei_nga_user_agent";
9 | $.body = "vei_nga_body";
10 |
11 | !(async () => {
12 | const headers = Object.keys($request.headers).reduce(
13 | (t, i) => ((t[i.toLowerCase()] = $request.headers[i]), t),
14 | {}
15 | );
16 | if ($request.body.includes("------WebKitForm")) {
17 | const cookie = headers["cookie"];
18 | const contentType = headers["content-type"];
19 | const userAgent = headers["user-agent"];
20 | const body = $request.body;
21 | var obj = FormDataToObject(body, contentType);
22 | if (obj["__lib"] === "mission" && obj["__act"] === "get_default") {
23 | $.setdata(cookie, $.cookie);
24 | $.setdata(contentType, $.contentType);
25 | $.setdata(userAgent, $.userAgent);
26 | var obj = FormDataToObject(body, contentType);
27 | $.setdata(JSON.stringify(obj), $.body);
28 |
29 | $.subt = `获取会话: 成功! `;
30 | $.msg($.name, $.subt, $.desc);
31 | }
32 | }
33 | })()
34 | .catch((e) => $.logErr(e))
35 | .finally(() => $.done());
36 |
37 | function FormDataToObject(form, contentType) {
38 | const boundary = contentType.split("; ")[1].split("=")[1];
39 | const splitBoundary = `--${boundary}`;
40 | const index = form.indexOf(splitBoundary);
41 | form = form.substr(index);
42 | const lastIndex = form.lastIndexOf(splitBoundary);
43 | form = form.substring(0, lastIndex);
44 | const array = compact(form.split(splitBoundary)).map((a) => {
45 | const entity = compact(a.split("\r\n"));
46 | const regex = /Content-Disposition: form-data; name="(.*)"/;
47 | var matchs = regex.exec(entity[0]);
48 | return {
49 | name: matchs[1],
50 | value: entity[1],
51 | };
52 | });
53 |
54 | function compact(array) {
55 | let resIndex = 0;
56 | const result = [];
57 | if (array == null) {
58 | return result;
59 | }
60 | for (const value of array) {
61 | if (value) {
62 | result[resIndex++] = value;
63 | }
64 | }
65 | return result;
66 | }
67 |
68 | const result = {};
69 | array.forEach((a) => {
70 | result[a.name] = a.value;
71 | });
72 | return result;
73 | }
74 |
75 | /***************** Env *****************/
76 | // prettier-ignore
77 | function Env(t, e) { class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), a = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(a, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t) { let e = { "M+": (new Date).getMonth() + 1, "d+": (new Date).getDate(), "H+": (new Date).getHours(), "m+": (new Date).getMinutes(), "s+": (new Date).getSeconds(), "q+": Math.floor(((new Date).getMonth() + 3) / 3), S: (new Date).getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length))); for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="]; h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) }
78 |
--------------------------------------------------------------------------------
/Scripts/nga/nga.js:
--------------------------------------------------------------------------------
1 | const $ = new Env("NGA刮墙");
2 | $.cookie = "vei_nga_cookie";
3 | $.contentType = "vei_nga_content_type";
4 | $.userAgent = "vei_nga_user_agent";
5 | $.body = "vei_nga_body";
6 |
7 | const cookie = $.getdata($.cookie);
8 | const contentType = $.getdata($.contentType);
9 | const userAgent = $.getdata($.userAgent);
10 | const body = $.getdata($.body);
11 |
12 | if (!cookie || !contentType || !userAgent || !body) {
13 | $.msg($.name, "请更新脚本并重新获取Cookie", $.desc);
14 | $.done();
15 | } else {
16 | !(async () => {
17 | await checkin();
18 | const mids = await missions();
19 | for (const mid of mids) {
20 | await checkInCountAdd(mid);
21 | }
22 | })()
23 | .catch((e) => $.logErr(e))
24 | .finally(() => $.done());
25 | }
26 |
27 | function checkin() {
28 | const newBody = { ...JSON.parse(body) };
29 | newBody["__lib"] = "check_in";
30 | newBody["__act"] = "check_in";
31 | const promise = new Promise((resolve) => {
32 | const options = {
33 | url: "https://ngabbs.com/nuke.php",
34 | headers: {
35 | "Content-Type": contentType,
36 | Cookie: cookie,
37 | "User-Agent": userAgent,
38 | },
39 | body: ObjectToFormData(newBody, contentType),
40 | };
41 | $.post(options, (err, resp, data) => {
42 | try {
43 | if (err) {
44 | $.logErr(err, resp);
45 | $.msg($.name, "刮墙失败,详细参见日志", err);
46 | } else if (resp.status === 200) {
47 | console.log(data);
48 | const result = JSON.parse(data);
49 | if (result.error) {
50 | $.msg($.name, "刮墙失败", result.error.join(";"));
51 | } else if (result.data) {
52 | const message = result.data[0];
53 | const continued = result.data[1].continued;
54 | const sum = result.data[1].sum;
55 | $.msg($.name, message, `连续刮墙${continued}天,累计刮墙${sum}天`);
56 | }
57 | }
58 | } catch (e) {
59 | $.logErr(e, resp);
60 | } finally {
61 | resolve();
62 | }
63 | });
64 | });
65 | return promise;
66 | }
67 |
68 | function missions() {
69 | const promise = new Promise((resolve) => {
70 | const newBody = { ...JSON.parse(body) };
71 | newBody["__lib"] = "mission";
72 | newBody["__act"] = "get_default";
73 | newBody["get_success_repeat"] = "1";
74 | newBody["no_compatible_fix"] = "1";
75 | const options = {
76 | url: "https://ngabbs.com/nuke.php",
77 | headers: {
78 | "Content-Type": contentType,
79 | Cookie: cookie,
80 | "User-Agent": userAgent,
81 | },
82 | body: ObjectToFormData(newBody, contentType),
83 | };
84 |
85 | $.post(options, (err, resp, data) => {
86 | try {
87 | if (err) {
88 | $.logErr(err, resp);
89 | } else {
90 | const result = JSON.parse(data);
91 | const mids = result.data[0].map((d) => d.id);
92 | resolve(mids);
93 | }
94 | } catch (e) {
95 | $.logErr(e, resp);
96 | resolve([]);
97 | }
98 | });
99 | });
100 | return promise;
101 | }
102 |
103 | function checkInCountAdd(mid) {
104 | const promise = new Promise((resolve) => {
105 | const newBody = { ...JSON.parse(body) };
106 | newBody["__lib"] = "mission";
107 | newBody["__act"] = "checkin_count_add";
108 | newBody["no_compatible_fix"] = "1";
109 | newBody["mid"] = mid;
110 | const options = {
111 | url: "https://ngabbs.com/nuke.php",
112 | headers: {
113 | "Content-Type": contentType,
114 | Cookie: cookie,
115 | "User-Agent": userAgent,
116 | },
117 | body: ObjectToFormData(newBody, contentType),
118 | };
119 |
120 | $.post(options, (err, resp, data) => {
121 | try {
122 | if (err) {
123 | $.logErr(err, resp);
124 | } else {
125 | console.log(`mission:${mid}`);
126 | }
127 | } catch (e) {
128 | $.logErr(e, resp);
129 | } finally {
130 | resolve();
131 | }
132 | });
133 | });
134 | return promise;
135 | }
136 |
137 | function ObjectToFormData(object, contentType) {
138 | const boundary = contentType.split("; ")[1].split("=")[1];
139 | const splitBoundary = `--${boundary}`;
140 | var body = `${splitBoundary}\r\n`;
141 | const array = [];
142 | for (const key in object) {
143 | if (object.hasOwnProperty(key)) {
144 | array.push({
145 | name: key,
146 | value: object[key],
147 | });
148 | }
149 | }
150 | var data = array.map((element) => {
151 | var name = `Content-Disposition: form-data; name="${element.name}"`;
152 | var entityString = `${name}\r\n\r\n${element.value}`;
153 | return entityString;
154 | });
155 | body = `${body}${data.join(
156 | `\r\n${splitBoundary}\r\n`
157 | )}\r\n${splitBoundary}--\r\n`;
158 | return body;
159 | }
160 |
161 | /***************** Env *****************/
162 | // prettier-ignore
163 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)}
164 |
--------------------------------------------------------------------------------
/Scripts/weibo/weibotalk.js:
--------------------------------------------------------------------------------
1 | /**********
2 | 🐬作者
3 | @Evilbutcher。 https://github.com/evilbutcher
4 | @toulanboy。https://github.com/toulanboy/scripts
5 |
6 | 📌不定期更新各种签到、有趣的脚本,欢迎star🌟
7 |
8 | ***********************************
9 | 【配置步骤,请认真阅读,每一个细节都很重要】
10 | ***********************************
11 | 1. 根据你当前的软件,配置好srcipt。由于是远程文件,记得顺便更新文件。
12 | 2. 打开微博APP --> 底部栏“我的“ --> 中间的”超话社区“ --> 底部栏"我的" --> ”关注“, 弹出通知,提示获取已关注超话链接成功。
13 | 3. 点进一个超话页面,手动签到一次。弹出通知,提示获取超话签到链接成功。 若之前所有已经签到,请关注一个新超话进行签到。
14 | 4. 回到quanx等软件,关掉获取cookie的rewrite。(loon是关掉获取cookie的脚本)
15 |
16 | 📌 配置第2个账号方法:第1个账号获取cookie结束后。在微博app中切换到第2个号,进行相同的获取逻辑。
17 |
18 | ***************************************
19 | 【boxjs 订阅, 用于修改脚本配置】
20 | ***************************************
21 | box订阅链接:https://raw.githubusercontent.com/toulanboy/scripts/master/toulanboy.boxjs.json
22 | 订阅后,可以在box里面进行 cookie清空、通知个数、签到延迟 等设置.
23 |
24 | *************************
25 | 【Surge 4.2+ 脚本配置】
26 | *************************
27 | 微博超话cookie获取 = type=http-request,pattern=^https?://m?api\.weibo\.c(n|om)\/2\/(cardlist|page\/button),script-path=https://raw.githubusercontent.com/toulanboy/scripts/master/weibo/weibotalk.cookie.js
28 | 微博超话 = type=cron,cronexp="5 0 * * *",script-path=https://raw.githubusercontent.com/toulanboy/scripts/master/weibo/weibotalk.js,wake-system=true,timeout=600
29 |
30 | *************************
31 | 【Loon 2.1+ 脚本配置】
32 | *************************
33 | [script]
34 | cron "5 0 * * *" script-path=https://raw.githubusercontent.com/toulanboy/scripts/master/weibo/weibotalk.js, timeout=600, tag=微博超话
35 | http-request ^https?://m?api\.weibo\.c(n|om)\/2\/(cardlist|page\/button) script-path=https://raw.githubusercontent.com/toulanboy/scripts/master/weibo/weibotalk.cookie.js,requires-body=false, tag=微博超话cookie获取
36 |
37 | *************************
38 | 【 QX 1.0.10+ 脚本配置 】
39 | *************************
40 | [rewrite_local]
41 | ^https?://m?api\.weibo\.c(n|om)\/2\/(cardlist|page\/button) url script-request-header https://raw.githubusercontent.com/toulanboy/scripts/master/weibo/weibotalk.cookie.js
42 | [task]
43 | 5 0 * * * https://raw.githubusercontent.com/toulanboy/scripts/master/weibo/weibotalk.js, tag=微博超话
44 |
45 |
46 | [MITM]
47 | hostname = api.weibo.cn
48 |
49 | *********/
50 |
51 | const $ = new Env("微博超话");
52 |
53 | /*
54 | * 可自定义的参数
55 | */
56 | $.delete_cookie = false; //若需要清空cookie,请把它置为true。清空完毕后,请重新置为false.
57 | $.msg_max_num = 30; //一个通知显示30个超话的签到情况
58 | $.time = 700; //【签到间隔,单位ms】,若超话过多,建议填1000ms以上。
59 | debug = false;
60 |
61 | !(async () => {
62 | if (!get_setting()) return;
63 | if (!get_counts()) return;
64 | console.log(`🌟 账号数 = ${$.count_num}`);
65 | for (var current = 1; current <= $.count_num; ++current) {
66 | init_env(current);
67 | await get_talk_id(1);
68 | for (var i in $.name_list) {
69 | await checkin($.id_list[i], $.name_list[i]);
70 | $.wait($.time);
71 | }
72 | output(current);
73 | }
74 | })()
75 | .catch((e) => {
76 | $.log("", `❌ ${$.name}, 失败! 原因: ${e}!`, "");
77 | })
78 | .finally(() => {
79 | $.done();
80 | });
81 |
82 | function get_setting() {
83 | $.delete_cookie = JSON.parse($.getdata("wb_delete_cookie") || $.delete_cookie);
84 | $.msg_max_num = $.getdata("wb_msg_max_num") * 1 || $.msg_max_num;
85 | $.time = $.getdata("wb_request_time") * 1 || $.time;
86 |
87 | $.listurl = $.getdata("evil_tokenurl");
88 | $.listheaders = $.getdata("evil_tokenheaders");
89 | $.checkinurl = $.getdata("evil_tokencheckinurl");
90 | $.checkinheaders = $.getdata("evil_tokencheckinheaders");
91 |
92 | $.listurl2 = $.getdata("evil_tokenurl2");
93 | $.listheaders2 = $.getdata("evil_tokenheaders2");
94 | $.checkinurl2 = $.getdata("evil_tokencheckinurl2");
95 | $.checkinheaders2 = $.getdata("evil_tokencheckinheaders2");
96 | if ($.delete_cookie) {
97 | $.setdata("", "evil_tokenurl");
98 | $.setdata("", "evil_tokenheaders");
99 | $.setdata("", "evil_tokencheckinurl");
100 | $.setdata("", "evil_tokencheckinheaders");
101 |
102 | $.setdata("", "evil_tokenurl2");
103 | $.setdata("", "evil_tokenheaders2");
104 | $.setdata("", "evil_tokencheckinurl2");
105 | $.setdata("", "evil_tokencheckinheaders2");
106 | $.setdata("false", "wb_delete_cookie");
107 | $.msg($.name, "", "✅已清空cookie,同时已关闭清空功能。\n🔍请按流程开始获取cookie把~");
108 | return false;
109 | }
110 | return true;
111 | }
112 |
113 | function get_counts() {
114 | $.count_num = 0;
115 | if (
116 | $.listurl == undefined ||
117 | $.listurl == "" ||
118 | $.listheaders == undefined ||
119 | $.listheaders == "" ||
120 | $.checkinurl == undefined ||
121 | $.checkinurl == "" ||
122 | $.checkinheaders == undefined ||
123 | $.checkinheaders == ""
124 | ) {
125 | $.msg(
126 | $.name,
127 | "🚫cookie不完整 或 没有cookie",
128 | "🚫请认真阅读配置,按流程获取cookie。\n🔍若仍无法解决,请先清空cookie再获取。\n🔍如何清空?\n1️⃣本地文件:将文件内delete_cookie置为true。\n2️⃣远程文件:使用boxjs,在box内打开清空cookie开关"
129 | );
130 | return false;
131 | } else {
132 | $.count_num = 1;
133 | }
134 | if (
135 | !(
136 | $.listurl2 == undefined ||
137 | $.listurl2 == "" ||
138 | $.listheaders2 == undefined ||
139 | $.listheaders2 == "" ||
140 | $.checkinurl2 == undefined ||
141 | $.checkinurl2 == "" ||
142 | $.checkinheaders2 == undefined ||
143 | $.checkinheaders2 == ""
144 | )
145 | ) {
146 | $.count_num = 2;
147 | }
148 | return true;
149 | }
150 |
151 | function init_env(current) {
152 | console.log(`🌟 清空环境,开始账号 ${current}`);
153 | $.message = [];
154 | $.name_list = [];
155 | $.id_list = [];
156 | $.val_list = [];
157 | $.successNum = 0;
158 | $.failNum = 0;
159 | $.allnumber = 0;
160 | $.pagenumber = 0;
161 | $.stopNum = 0;
162 | if (current == 2) {
163 | $.listurl = $.listurl2;
164 | $.listheaders = $.listheaders2;
165 | $.checkinurl = $.checkinurl2;
166 | $.checkinheaders = $.checkinheaders2;
167 | }
168 | }
169 |
170 | function output(current) {
171 | $.this_msg = "";
172 | for (var i = 1; i <= $.message.length; ++i) {
173 | if (i % $.msg_max_num == 0) {
174 | $.msg(
175 | `${$.name}${$.count_num == 1 ? "" : current == 1 ? "[账号一]" : "[账号二]"}: 成功${$.successNum}个,失败${$.failNum}`,
176 | `当前第${Math.ceil(i / $.msg_max_num)}页 ,共${Math.ceil($.message.length / $.msg_max_num)}页`,
177 | $.this_msg
178 | );
179 | $.this_msg = "";
180 | }
181 | $.this_msg += `${$.message[i - 1]}\n`;
182 | }
183 | if ($.message.length % $.msg_max_num != 0) {
184 | $.msg(
185 | `${$.name}${$.count_num == 1 ? "" : current == 1 ? "[账号一]" : "[账号二]"}: 成功${$.successNum}个,失败${$.failNum}`,
186 | `当前第${Math.ceil((i - 1) / $.msg_max_num)}页 ,共${Math.ceil($.message.length / $.msg_max_num)}页`,
187 | $.this_msg
188 | );
189 | }
190 | }
191 |
192 | function get_page_number() {
193 | return new Promise((resolve) => {
194 | var idrequest = {
195 | url: $.listurl,
196 | header: $.listheaders,
197 | };
198 | $.get(idrequest, (error, response, data) => {
199 | if (error) {
200 | throw new Error(error);
201 | }
202 | var body = response.body;
203 | var obj = JSON.parse(body);
204 | if (obj.hasOwnProperty("errmsg") || obj.cardlistInfo.total == undefined || obj.cardlistInfo.total == null) {
205 | $.msg($.name, "🚨获取页数出现错误", `⚠️微博原话:${obj.errmsg}\n🧑🏻💻作者:账号过期了,清空cookie吧,重新获取。`);
206 | $.pagenumber = 0;
207 | resolve();
208 | return;
209 | }
210 | $.allnumber = obj.cardlistInfo.total;
211 | console.log("当前已关注超话" + $.allnumber + "个");
212 | // $.message.push(`当前已关注超话${allnumber}个`);
213 | $.pagenumber = Math.ceil($.allnumber / 20);
214 | //$notify("超话","",JSON.stringify($.message))
215 | resolve();
216 | });
217 | });
218 | }
219 |
220 | //获取超话签到id
221 | function get_talk_id(page) {
222 | var getlisturl = $.listurl.replace(new RegExp("&page=.*?&"), "&page=" + page + "&");
223 | //console.log(getlisturl);
224 | var idrequest = {
225 | url: getlisturl,
226 | header: $.listheaders,
227 | };
228 | // console.log(idrequest)
229 | return new Promise((resove) => {
230 | $.get(idrequest, (error, response, data) => {
231 | if (error) {
232 | throw new Error(error);
233 | }
234 | var body = response.body;
235 | var obj = JSON.parse(body);
236 | if (obj.hasOwnProperty("errmsg") || obj.cards == undefined || obj.cards == null) {
237 | $.msg($.name, "🚨获取超话ID出现错误", `⚠️微博原话:${obj.errmsg}\n`);
238 | resolve();
239 | return;
240 | }
241 | var group = obj.cards[0]["card_group"];
242 | number = group.length;
243 | for (i = 0; i < number; i++) {
244 | var name = group[i]["title_sub"];
245 | $.name_list.push(name);
246 | var val = group[i].desc;
247 | $.val_list.push(val);
248 | // var id = group[i].scheme.slice(33, 71);
249 | var id = group[i].scheme.replace("sinaweibo://pageinfo?containerid=", "");
250 | $.id_list.push(id);
251 | if (debug) {
252 | console.log(name);
253 | console.log(val);
254 | console.log(id);
255 | }
256 | // checkin(id, name, val, time);
257 | }
258 | resove();
259 | });
260 | });
261 | }
262 |
263 | //签到
264 | function checkin(id, name) {
265 | var sendcheckinurl = $.checkinurl.replace(new RegExp("&fid=.*?&"), "&fid=" + id + "&").replace(new RegExp("pageid%3D.*?%26"), "pageid%3D" + id + "%26");
266 | var checkinrequest = {
267 | url: sendcheckinurl,
268 | header: $.checkinheaders,
269 | };
270 | return new Promise((resolve) => {
271 | $.get(checkinrequest, (error, response, data) => {
272 | if (error) {
273 | throw new Error(error);
274 | }
275 | name = name.replace(/超话/, "");
276 | if (response.statusCode == 200) {
277 | msg_info = JSON.parse(response.body);
278 | if (msg_info.hasOwnProperty("errcode")) {
279 | $.failNum += 1;
280 | error_code = msg_info.errcode;
281 | if (error_code == 382004) {
282 | $.message.push(`【${name}】:✨今天已签到`);
283 | console.log(`【${name}】:${msg_info.error_msg}`);
284 | } else {
285 | $.message.push(`【${name}】:${msg_info.error_msg}`);
286 | console.log(`【${name}】:"未知错误⚠️ 该请求的返回情况如下"`);
287 | console.log(response.body);
288 | }
289 | } else if (msg_info.hasOwnProperty("result") && msg_info.result == 1) {
290 | $.successNum += 1;
291 | $.message.push(`【${name}】:✅${msg_info.button.name}`);
292 | console.log(`【${name}】:${msg_info.button.name}`);
293 | } else {
294 | $.failNum += 1;
295 | $.message.push(`【${name}】:未知错误⚠️`);
296 | console.log(`【${name}】:"未知错误⚠️ 该请求的返回情况如下"`);
297 | console.log(response.body);
298 | }
299 | } else if (response.statusCode == 418) {
300 | $.failNum += 1;
301 | $.message.push(`【${name}】:"签到太频繁啦,请稍后再试"`);
302 | console.log(`【${name}】:"签到太频繁啦,请稍后再试"`);
303 | } else if (response.statusCode == 511) {
304 | $.failNum += 1;
305 | $.message.push(`【${name}】:"需要身份验证,请稍后再试"`);
306 | console.log(`【${name}】:"需要身份验证,请稍后再试"`);
307 | } else {
308 | $.failNum += 1;
309 | $.message.push(`【${name}】:未知错误⚠️`);
310 | console.log(`【${name}】:"未知错误⚠️ 该请求的返回情况如下"`);
311 | console.log(JSON.stringify(response));
312 | }
313 | resolve();
314 | });
315 | });
316 | }
317 | //@Chavy
318 | function Env(s) {
319 | (this.name = s),
320 | (this.data = null),
321 | (this.logs = []),
322 | (this.isSurge = () => "undefined" != typeof $httpClient),
323 | (this.isQuanX = () => "undefined" != typeof $task),
324 | (this.isNode = () => "undefined" != typeof module && !!module.exports),
325 | (this.log = (...s) => {
326 | (this.logs = [...this.logs, ...s]), s ? console.log(s.join("\n")) : console.log(this.logs.join("\n"));
327 | }),
328 | (this.msg = (s = this.name, t = "", i = "") => {
329 | this.isSurge() && $notification.post(s, t, i), this.isQuanX() && $notify(s, t, i);
330 | const e = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];
331 | s && e.push(s), t && e.push(t), i && e.push(i), console.log(e.join("\n"));
332 | }),
333 | (this.getdata = (s) => {
334 | if (this.isSurge()) return $persistentStore.read(s);
335 | if (this.isQuanX()) return $prefs.valueForKey(s);
336 | if (this.isNode()) {
337 | const t = "box.dat";
338 | return (this.fs = this.fs ? this.fs : require("fs")), this.fs.existsSync(t) ? ((this.data = JSON.parse(this.fs.readFileSync(t))), this.data[s]) : null;
339 | }
340 | }),
341 | (this.setdata = (s, t) => {
342 | if (this.isSurge()) return $persistentStore.write(s, t);
343 | if (this.isQuanX()) return $prefs.setValueForKey(s, t);
344 | if (this.isNode()) {
345 | const i = "box.dat";
346 | return (
347 | (this.fs = this.fs ? this.fs : require("fs")),
348 | !!this.fs.existsSync(i) && ((this.data = JSON.parse(this.fs.readFileSync(i))), (this.data[t] = s), this.fs.writeFileSync(i, JSON.stringify(this.data)), !0)
349 | );
350 | }
351 | }),
352 | (this.wait =
353 | (s, t = s) =>
354 | (i) =>
355 | setTimeout(() => i(), Math.floor(Math.random() * (t - s + 1) + s))),
356 | (this.get = (s, t) => this.send(s, "GET", t)),
357 | (this.post = (s, t) => this.send(s, "POST", t)),
358 | (this.send = (s, t, i) => {
359 | if (this.isSurge()) {
360 | const e = "POST" == t ? $httpClient.post : $httpClient.get;
361 | e(s, (s, t, e) => {
362 | t && ((t.body = e), (t.statusCode = t.status)), i(s, t, e);
363 | });
364 | }
365 | this.isQuanX() &&
366 | ((s.method = t),
367 | $task.fetch(s).then(
368 | (s) => {
369 | (s.status = s.statusCode), i(null, s, s.body);
370 | },
371 | (s) => i(s.error, s, s)
372 | )),
373 | this.isNode() &&
374 | ((this.request = this.request ? this.request : require("request")),
375 | (s.method = t),
376 | (s.gzip = !0),
377 | this.request(s, (s, t, e) => {
378 | t && (t.status = t.statusCode), i(null, t, e);
379 | }));
380 | }),
381 | (this.done = (s = {}) => (this.isNode() ? null : $done(s)));
382 | }
383 |
--------------------------------------------------------------------------------
/Scripts/weibo/weibo.task.js:
--------------------------------------------------------------------------------
1 | /*
2 | 更新时间: 2021-02-21 22:30
3 |
4 | 本脚本仅适用于微博每日签到,支持多账号运行
5 |
6 |
7 | 获取ck: https:\/\/api\.weibo\.cn\/\d\/users\/show url script-request-header weibo.js
8 | */
9 |
10 | const $ = new Env("新浪微博");
11 | const notify = $.isNode() ? require("./sendNotify") : "";
12 | let tokenArr = [],
13 | cookieArr = [];
14 | let wbtoken = $.getdata("sy_token_wb");
15 | let cookies = $.getdata("wb_cookie");
16 | let signcash = "";
17 |
18 | if ((isGetCookie = typeof $request !== `undefined`)) {
19 | GetCookie();
20 | $.done();
21 | } else {
22 | !(async () => {
23 | if (!$.isNode() && wbtoken.indexOf("#") == -1) {
24 | tokenArr.push(wbtoken);
25 | cookieArr.push(cookies);
26 | } else {
27 | if ($.isNode()) {
28 | if (process.env.WB_TOKEN && process.env.WB_TOKEN.indexOf("#") > -1) {
29 | wbtoken = process.env.WB_TOKEN.split("#");
30 | console.log(`WB_TOKEN您选择的是用"#"隔开\n`);
31 | } else if (process.env.WB_TOKEN && process.env.WB_TOKEN.indexOf("\n") > -1) {
32 | wbtoken = process.env.WB_TOKEN.split("\n");
33 | console.log(`WB_TOKEN您选择的是用换行隔开\n`);
34 | } else {
35 | wbtoken = [process.env.WB_TOKEN];
36 | }
37 | if (process.env.WB_COOKIE && process.env.WB_COOKIE.indexOf("#") > -1) {
38 | cookies = process.env.WB_COOKIE.split("#");
39 | console.log(`WB_COOKIE您选择的是用"#"隔开\n`);
40 | } else if (process.env.WB_COOKIE && process.env.WB_COOKIE.indexOf("\n") > -1) {
41 | cookies = process.env.WB_COOKIE.split("\n");
42 | console.log(`WB_COOKIE您选择的是用换行隔开\n`);
43 | } else {
44 | cookies = [process.env.WB_COOKIE];
45 | }
46 | } else if (!$.isNode() && wbtoken.indexOf("#") > -1) {
47 | wbtoken = wbtoken.split("#");
48 | cookies = cookies.split("#");
49 | }
50 | Object.keys(wbtoken).forEach((item) => {
51 | if (wbtoken[item]) {
52 | tokenArr.push(wbtoken[item]);
53 | }
54 | });
55 | Object.keys(cookies).forEach((item) => {
56 | if (cookies[item]) {
57 | cookieArr.push(cookies[item]);
58 | }
59 | });
60 | }
61 | if (!tokenArr[0]) {
62 | $.msg($.name, "【提示】请先获取新浪微博一cookie");
63 | return;
64 | }
65 | timeZone = new Date().getTimezoneOffset() / 60;
66 | timestamp = Date.now() + (8 + timeZone) * 60 * 60 * 1000;
67 | bjTime = new Date(timestamp).toLocaleString("zh", {
68 | hour12: false,
69 | timeZoneName: "long",
70 | });
71 | console.log(`\n === 脚本执行 ${bjTime} ===\n`);
72 | console.log(`------------- 共${tokenArr.length}个账号\n`);
73 | for (let i = 0; i < tokenArr.length; i++) {
74 | if (tokenArr[i]) {
75 | token = tokenArr[i];
76 | cookie = cookieArr[i];
77 | $.index = i + 1;
78 | console.log(`\n开始【微博签到${$.index}】`);
79 | if (token.indexOf("from") == -1) {
80 | token += "from=10B2193010&";
81 | }
82 | await getsign();
83 | await doCard();
84 | await paysign();
85 | await showmsg();
86 | }
87 | }
88 | })()
89 | .catch((e) => $.logErr(e))
90 | .finally(() => $.done());
91 | }
92 |
93 | function GetCookie() {
94 | if ($request && $request.method != "OPTIONS" && $request.url.indexOf("gsid=") > -1) {
95 | const signurlVal = $request.url;
96 | let token = signurlVal.replace(
97 | /(.+)(from=\w+)(.+)(&uid=\d+)(.+)(&gsid=[_a-zA-Z0-9-]+)(&.+)(&s=\w+)(.+)/,
98 | "$2$4$6$8"
99 | ),
100 | uid = token.match(/uid=\d+/)[0];
101 | if (wbtoken) {
102 | if (wbtoken.indexOf(uid) > -1) {
103 | $.log("此账号Cookie已存在,本次跳过");
104 | } else if (wbtoken.indexOf(uid) == -1) {
105 | tokens = wbtoken + "#" + token;
106 | $.setdata(tokens, "sy_token_wb");
107 | $.log(`tokens: ${tokens}`);
108 | $.msg($.name, `获取微博签到Cookie: 成功`, ``);
109 | }
110 | } else {
111 | $.setdata(token, "sy_token_wb");
112 | $.log(`tokens: ${token}`);
113 | $.msg($.name, `获取微博签到Cookie: 成功`, ``);
114 | }
115 | } else if ($request && $request.method != "OPTIONS" && $request.headers.Cookie.indexOf("SUB=") > -1) {
116 | const cookieval = $request.headers.Cookie.match(/SUB=[\w\-]+/)[0];
117 | if (cookies) {
118 | if (cookies.indexOf(cookieval) > -1) {
119 | $.log("此账号Cookie已存在,本次跳过");
120 | } else if (cookies.indexOf(cookieval) == -1) {
121 | cookie = cookies + "#" + cookieval;
122 | $.setdata(cookie, "wb_cookie");
123 | Cookies = cookie.split("#");
124 | $.log(`cookie: ${cookie}`);
125 | $.msg($.name, "获取微博用户" + Cookies.length + "Cookie: 成功", ``);
126 | }
127 | } else {
128 | $.setdata(cookieval, "wb_cookie");
129 | $.log(`cookies: ${cookieval}`);
130 | $.msg($.name, `获取微博用户Cookie: 成功`, ``);
131 | }
132 | }
133 | }
134 | //微博签到
135 |
136 | function getsign() {
137 | return new Promise((resolve, reject) => {
138 | let signurl = {
139 | url: `https://api.weibo.cn/2/checkin/add?c=iphone&${token}`,
140 | headers: {
141 | "User-Agent": `Weibo/52021 (iPhone; iOS 14.5; Scale/3.00)`,
142 | },
143 | };
144 | $.get(signurl, async (error, resp, data) => {
145 | let result = JSON.parse(data);
146 | if (result.status == 10000) {
147 | wbsign = `【微博签到】✅ 连续签到${result.data.continuous}天,收益: ${result.data.desc}💰\n`;
148 | } else if (result.errno == 30000) {
149 | wbsign = `【每日签到】 🔁 已签到\n`;
150 | if (cookie) {
151 | await getcash();
152 | }
153 | } else if (result.status == 90005) {
154 | wbsign = `【每日签到】‼️` + result.msg + "\n";
155 | } else {
156 | wbsign = `【每日签到】 ❌ 签到失败 ` + result.errmsg;
157 | $.msg($.name, wbsign, `请检查微博Token`);
158 | if ($.isNode()) {
159 | await notify.sendNotify($.name, wbsign);
160 | }
161 | }
162 | resolve();
163 | });
164 | });
165 | }
166 |
167 | function getcash() {
168 | return new Promise((resolve, reject) => {
169 | let url = {
170 | url: `https://m.weibo.cn/c/checkin/getcashdetail`,
171 | headers: {
172 | "User-Agent": `Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Weibo (iPhone10,2__weibo__11.2.1__iphone__os14.5)`,
173 | Cookie: cookie,
174 | },
175 | };
176 | $.get(url, async (error, resp, data) => {
177 | let cashres = JSON.parse(data);
178 | if (cashres.apiCode == 10000) {
179 | signcash = " " + cashres.data.header[0].title + cashres.data.header[0].value + "元";
180 | }
181 | resolve();
182 | });
183 | });
184 | }
185 |
186 | function doCard() {
187 | return new Promise((resolve, reject) => {
188 | let doCardurl = {
189 | url: `https://api.weibo.cn/2/!/ug/king_act_home?c=iphone&${token}`,
190 | headers: {
191 | "User-Agent": `Weibo/52021 (iPhone; iOS 14.5; Scale/3.00)`,
192 | },
193 | };
194 | $.get(doCardurl, (error, resp, data) => {
195 | //$.log(data)
196 | let result = JSON.parse(data);
197 | if (result.status == 10000) {
198 | nickname = "昵称: " + result.data.user.nickname;
199 | if (tokenArr.length == 1) {
200 | $.setdata(nickname, "wb_nick");
201 | } else {
202 | $.setdata(tokenArr.length + "合一(多账号)", "wb_nick");
203 | }
204 | signday = result.data.signin.title.split("<")[0];
205 | docard = `【每日打卡】 ✅ ` + signday + "天 积分总计: " + result.data.user.energy;
206 | } else {
207 | docard = `【每日打卡】 ❌ 活动过期或失效`;
208 | }
209 | resolve();
210 | });
211 | });
212 | }
213 |
214 | // 钱包签到
215 | function paysign() {
216 | return new Promise((resolve, reject) => {
217 | $.post(payApi("aj/mobile/home/welfare/signin/do?_=" + $.startTime + 10), async (error, resp, data) => {
218 | let result = JSON.parse(data);
219 | if (result.status == 1) {
220 | paybag = `【微博钱包】 ✅ +` + result.score + " 分\n";
221 | } else if (result.status == "2") {
222 | paybag = `【微博钱包】 🔁 `;
223 | await payinfo();
224 | } else {
225 | paybag = `【钱包签到】❌ Cookie失效` + "\n";
226 | }
227 | resolve();
228 | });
229 | });
230 | }
231 |
232 | function payApi(api) {
233 | return {
234 | url: "https://pay.sc.weibo.com/" + api,
235 | headers: {
236 | "Accept-Encoding": "gzip, deflate",
237 | Connection: "keep-alive",
238 | "Content-Type": "application/x-www-form-urlencoded",
239 | Host: "pay.sc.weibo.com",
240 | "User-Agent":
241 | "Mozilla/5.0 (iPhone; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Weibo (iPhone10,1__weibo__11.2.1__iphone__os14.5)",
242 | },
243 | body: token + "&lang=zh_CN&wm=3333_2001",
244 | };
245 | }
246 |
247 | function payinfo() {
248 | return new Promise((resolve, reject) => {
249 | $.post(payApi("api/client/sdk/app/balance"), (error, resp, data) => {
250 | let paynum = JSON.parse(data);
251 | if (paynum.code == 100000) {
252 | paybag += "现金:" + paynum.data.balance + " 元\n";
253 | }
254 | resolve();
255 | });
256 | });
257 | }
258 |
259 | async function showmsg() {
260 | if (paybag) {
261 | $.msg($.name, signcash ? signcash : "", wbsign + paybag + docard);
262 | if ($.isNode()) {
263 | await notify.sendNotify($.name, (signcash ? signcash : "") + "\n" + wbsign + paybag + docard);
264 | }
265 | }
266 | }
267 |
268 | // prettier-ignore
269 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)}
270 |
--------------------------------------------------------------------------------
/Scripts/ithome/ithome.task.js:
--------------------------------------------------------------------------------
1 | // prettier-ignore
2 | !function(t,e){"object"==typeof exports?module.exports=exports=e():"function"==typeof define&&define.amd?define([],e):t.CryptoJS=e()}(this,function(){var t,e,r,i,n,o,s,c,a,h,l=l||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r&&"function"==typeof require)try{r=require("crypto")}catch(t){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),o={},s=o.lib={},c=s.Base={extend:function(t){var e=n(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=s.WordArray=c.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||l).stringify(this)},concat:function(t){var e=this.words,r=t.words,i=this.sigBytes,n=t.sigBytes;if(this.clamp(),i%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[i+o>>>2]|=s<<24-(i+o)%4*8}else for(o=0;o>>2]=r[o>>>2];return this.sigBytes+=n,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=c.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-n%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new a.init(r,e/2)}},f=h.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new a.init(r,e)}},u=h.Utf8={stringify:function(t){try{return decodeURIComponent(escape(f.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return f.parse(unescape(encodeURIComponent(t)))}},d=s.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=u.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,i=this._data,n=i.words,o=i.sigBytes,s=this.blockSize,c=o/(4*s),h=(c=e?t.ceil(c):t.max((0|c)-this._minBufferSize,0))*s,l=t.min(4*h,o);if(h){for(var f=0;f>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,c=0;c<4&&o+.75*c>>6*(3-c)&63));var a=i.charAt(64);if(a)for(;n.length%4;)n.push(a);return n.join("")},parse:function(t){var r=t.length,i=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-s%4*2,h=c|a;n[o>>>2]|=h<<24-o%4*8,o++}return e.create(n,o)}(t,r,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(t){var e=l,r=e.lib,i=r.WordArray,n=r.Hasher,o=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=o.MD5=n.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,n=t[i];t[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o=this._hash.words,c=t[e+0],l=t[e+1],d=t[e+2],p=t[e+3],_=t[e+4],v=t[e+5],y=t[e+6],g=t[e+7],B=t[e+8],w=t[e+9],k=t[e+10],S=t[e+11],m=t[e+12],x=t[e+13],b=t[e+14],H=t[e+15],z=o[0],A=o[1],C=o[2],D=o[3];z=a(z,A,C,D,c,7,s[0]),D=a(D,z,A,C,l,12,s[1]),C=a(C,D,z,A,d,17,s[2]),A=a(A,C,D,z,p,22,s[3]),z=a(z,A,C,D,_,7,s[4]),D=a(D,z,A,C,v,12,s[5]),C=a(C,D,z,A,y,17,s[6]),A=a(A,C,D,z,g,22,s[7]),z=a(z,A,C,D,B,7,s[8]),D=a(D,z,A,C,w,12,s[9]),C=a(C,D,z,A,k,17,s[10]),A=a(A,C,D,z,S,22,s[11]),z=a(z,A,C,D,m,7,s[12]),D=a(D,z,A,C,x,12,s[13]),C=a(C,D,z,A,b,17,s[14]),z=h(z,A=a(A,C,D,z,H,22,s[15]),C,D,l,5,s[16]),D=h(D,z,A,C,y,9,s[17]),C=h(C,D,z,A,S,14,s[18]),A=h(A,C,D,z,c,20,s[19]),z=h(z,A,C,D,v,5,s[20]),D=h(D,z,A,C,k,9,s[21]),C=h(C,D,z,A,H,14,s[22]),A=h(A,C,D,z,_,20,s[23]),z=h(z,A,C,D,w,5,s[24]),D=h(D,z,A,C,b,9,s[25]),C=h(C,D,z,A,p,14,s[26]),A=h(A,C,D,z,B,20,s[27]),z=h(z,A,C,D,x,5,s[28]),D=h(D,z,A,C,d,9,s[29]),C=h(C,D,z,A,g,14,s[30]),z=f(z,A=h(A,C,D,z,m,20,s[31]),C,D,v,4,s[32]),D=f(D,z,A,C,B,11,s[33]),C=f(C,D,z,A,S,16,s[34]),A=f(A,C,D,z,b,23,s[35]),z=f(z,A,C,D,l,4,s[36]),D=f(D,z,A,C,_,11,s[37]),C=f(C,D,z,A,g,16,s[38]),A=f(A,C,D,z,k,23,s[39]),z=f(z,A,C,D,x,4,s[40]),D=f(D,z,A,C,c,11,s[41]),C=f(C,D,z,A,p,16,s[42]),A=f(A,C,D,z,y,23,s[43]),z=f(z,A,C,D,w,4,s[44]),D=f(D,z,A,C,m,11,s[45]),C=f(C,D,z,A,H,16,s[46]),z=u(z,A=f(A,C,D,z,d,23,s[47]),C,D,c,6,s[48]),D=u(D,z,A,C,g,10,s[49]),C=u(C,D,z,A,b,15,s[50]),A=u(A,C,D,z,v,21,s[51]),z=u(z,A,C,D,m,6,s[52]),D=u(D,z,A,C,p,10,s[53]),C=u(C,D,z,A,k,15,s[54]),A=u(A,C,D,z,l,21,s[55]),z=u(z,A,C,D,B,6,s[56]),D=u(D,z,A,C,H,10,s[57]),C=u(C,D,z,A,y,15,s[58]),A=u(A,C,D,z,x,21,s[59]),z=u(z,A,C,D,_,6,s[60]),D=u(D,z,A,C,S,10,s[61]),C=u(C,D,z,A,d,15,s[62]),A=u(A,C,D,z,w,21,s[63]),o[0]=o[0]+z|0,o[1]=o[1]+A|0,o[2]=o[2]+C|0,o[3]=o[3]+D|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;r[n>>>5]|=128<<24-n%32;var o=t.floor(i/4294967296),s=i;r[15+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(n+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(r.length+1),this._process();for(var c=this._hash,a=c.words,h=0;h<4;h++){var l=a[h];a[h]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return c},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});function a(t,e,r,i,n,o,s){var c=t+(e&r|~e&i)+n+s;return(c<>>32-o)+e}function h(t,e,r,i,n,o,s){var c=t+(e&i|r&~i)+n+s;return(c<>>32-o)+e}function f(t,e,r,i,n,o,s){var c=t+(e^r^i)+n+s;return(c<>>32-o)+e}function u(t,e,r,i,n,o,s){var c=t+(r^(e|~i))+n+s;return(c<>>32-o)+e}e.MD5=n._createHelper(c),e.HmacMD5=n._createHmacHelper(c)}(Math),e=(t=l).lib,r=e.WordArray,i=e.Hasher,n=t.algo,o=[],s=n.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],s=r[2],c=r[3],a=r[4],h=0;h<80;h++){if(h<16)o[h]=0|t[e+h];else{var l=o[h-3]^o[h-8]^o[h-14]^o[h-16];o[h]=l<<1|l>>>31}var f=(i<<5|i>>>27)+a+o[h];f+=h<20?1518500249+(n&s|~n&c):h<40?1859775393+(n^s^c):h<60?(n&s|n&c|s&c)-1894007588:(n^s^c)-899497514,a=c,c=s,s=n<<30|n>>>2,n=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+s|0,r[3]=r[3]+c|0,r[4]=r[4]+a|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(i+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}}),t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s),function(t){var e=l,r=e.lib,i=r.WordArray,n=r.Hasher,o=e.algo,s=[],c=[];!function(){function e(e){for(var r=t.sqrt(e),i=2;i<=r;i++)if(!(e%i))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var i=2,n=0;n<64;)e(i)&&(n<8&&(s[n]=r(t.pow(i,.5))),c[n]=r(t.pow(i,1/3)),n++),i++}();var a=[],h=o.SHA256=n.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],s=r[3],h=r[4],l=r[5],f=r[6],u=r[7],d=0;d<64;d++){if(d<16)a[d]=0|t[e+d];else{var p=a[d-15],_=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,v=a[d-2],y=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;a[d]=_+a[d-7]+y+a[d-16]}var g=i&n^i&o^n&o,B=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),w=u+((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+(h&l^~h&f)+c[d]+a[d];u=f,f=l,l=h,h=s+w|0,s=o,o=n,n=i,i=w+(B+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+h|0,r[5]=r[5]+l|0,r[6]=r[6]+f|0,r[7]=r[7]+u|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return r[n>>>5]|=128<<24-n%32,r[14+(n+64>>>9<<4)]=t.floor(i/4294967296),r[15+(n+64>>>9<<4)]=i,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=n._createHelper(h),e.HmacSHA256=n._createHmacHelper(h)}(Math),function(){var t=l,e=t.lib.WordArray,r=t.enc;r.Utf16=r.Utf16BE={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n>>2]>>>16-n%4*8&65535;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var r=t.length,i=[],n=0;n>>1]|=t.charCodeAt(n)<<16-n%2*16;return e.create(i,2*r)}};function i(t){return t<<8&4278255360|t>>>8&16711935}r.Utf16LE={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(s))}return n.join("")},parse:function(t){for(var r=t.length,n=[],o=0;o>>1]|=i(t.charCodeAt(o)<<16-o%2*16);return e.create(n,2*r)}}}(),function(){if("function"==typeof ArrayBuffer){var t=l.lib.WordArray,e=t.init;(t.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var r=t.byteLength,i=[],n=0;n>>2]|=t[n]<<24-n%4*8;e.call(this,i,r)}else e.apply(this,arguments)}).prototype=t}}(),function(t){var e=l,r=e.lib,i=r.WordArray,n=r.Hasher,o=e.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),a=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),h=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=i.create([0,1518500249,1859775393,2400959708,2840853838]),u=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=o.RIPEMD160=n.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,n=t[i];t[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o,l,d,w,k,S,m,x,b,H,z,A=this._hash.words,C=f.words,D=u.words,E=s.words,R=c.words,M=a.words,F=h.words;S=o=A[0],m=l=A[1],x=d=A[2],b=w=A[3],H=k=A[4];for(r=0;r<80;r+=1)z=o+t[e+E[r]]|0,z+=r<16?p(l,d,w)+C[0]:r<32?_(l,d,w)+C[1]:r<48?v(l,d,w)+C[2]:r<64?y(l,d,w)+C[3]:g(l,d,w)+C[4],z=(z=B(z|=0,M[r]))+k|0,o=k,k=w,w=B(d,10),d=l,l=z,z=S+t[e+R[r]]|0,z+=r<16?g(m,x,b)+D[0]:r<32?y(m,x,b)+D[1]:r<48?v(m,x,b)+D[2]:r<64?_(m,x,b)+D[3]:p(m,x,b)+D[4],z=(z=B(z|=0,F[r]))+H|0,S=H,H=b,b=B(x,10),x=m,m=z;z=A[1]+d+b|0,A[1]=A[2]+w+H|0,A[2]=A[3]+k+S|0,A[3]=A[4]+o+m|0,A[4]=A[0]+l+x|0,A[0]=z},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var n=this._hash,o=n.words,s=0;s<5;s++){var c=o[s];o[s]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return n},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,r){return t^e^r}function _(t,e,r){return t&e|~t&r}function v(t,e,r){return(t|~e)^r}function y(t,e,r){return t&r|e&~r}function g(t,e,r){return t^(e|~r)}function B(t,e){return t<>>32-e}e.RIPEMD160=n._createHelper(d),e.HmacRIPEMD160=n._createHmacHelper(d)}(Math),function(){var t=l,e=t.lib.Base,r=t.enc.Utf8;t.algo.HMAC=e.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=r.parse(e));var i=t.blockSize,n=4*i;e.sigBytes>n&&(e=t.finalize(e)),e.clamp();for(var o=this._oKey=e.clone(),s=this._iKey=e.clone(),c=o.words,a=s.words,h=0;h>>24)|4278255360&(o<<24|o>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(A=r[n]).high^=s,A.low^=o}for(var l=0;l<24;l++){for(var u=0;u<5;u++){for(var d=0,p=0,_=0;_<5;_++){d^=(A=r[u+5*_]).high,p^=A.low}var v=f[u];v.high=d,v.low=p}for(u=0;u<5;u++){var y=f[(u+4)%5],g=f[(u+1)%5],B=g.high,w=g.low;for(d=y.high^(B<<1|w>>>31),p=y.low^(w<<1|B>>>31),_=0;_<5;_++){(A=r[u+5*_]).high^=d,A.low^=p}}for(var k=1;k<25;k++){var S=(A=r[k]).high,m=A.low,x=c[k];x<32?(d=S<>>32-x,p=m<>>32-x):(d=m<>>64-x,p=S<>>64-x);var b=f[a[k]];b.high=d,b.low=p}var H=f[0],z=r[0];H.high=z.high,H.low=z.low;for(u=0;u<5;u++)for(_=0;_<5;_++){var A=r[k=u+5*_],C=f[k],D=f[(u+1)%5+5*_],E=f[(u+2)%5+5*_];A.high=C.high^~D.high&E.high,A.low=C.low^~D.low&E.low}A=r[0];var R=h[l];A.high^=R.high,A.low^=R.low}},_doFinalize:function(){var e=this._data,r=e.words,n=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(t.ceil((n+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var s=this._state,c=this.cfg.outputLength/8,a=c/8,h=[],l=0;l>>24)|4278255360&(u<<24|u>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),h.push(d),h.push(u)}return new i.init(h,c)},clone:function(){for(var t=n.clone.call(this),e=t._state=this._state.slice(0),r=0;r<25;r++)e[r]=e[r].clone();return t}});e.SHA3=n._createHelper(u),e.HmacSHA3=n._createHmacHelper(u)}(Math),function(){var t=l,e=t.lib.Hasher,r=t.x64,i=r.Word,n=r.WordArray,o=t.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],a=[];!function(){for(var t=0;t<80;t++)a[t]=s()}();var h=o.SHA512=e.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],s=r[3],h=r[4],l=r[5],f=r[6],u=r[7],d=i.high,p=i.low,_=n.high,v=n.low,y=o.high,g=o.low,B=s.high,w=s.low,k=h.high,S=h.low,m=l.high,x=l.low,b=f.high,H=f.low,z=u.high,A=u.low,C=d,D=p,E=_,R=v,M=y,F=g,P=B,W=w,O=k,I=S,U=m,K=x,X=b,L=H,j=z,N=A,T=0;T<80;T++){var q,Z,V=a[T];if(T<16)Z=V.high=0|t[e+2*T],q=V.low=0|t[e+2*T+1];else{var G=a[T-15],J=G.high,$=G.low,Q=(J>>>1|$<<31)^(J>>>8|$<<24)^J>>>7,Y=($>>>1|J<<31)^($>>>8|J<<24)^($>>>7|J<<25),tt=a[T-2],et=tt.high,rt=tt.low,it=(et>>>19|rt<<13)^(et<<3|rt>>>29)^et>>>6,nt=(rt>>>19|et<<13)^(rt<<3|et>>>29)^(rt>>>6|et<<26),ot=a[T-7],st=ot.high,ct=ot.low,at=a[T-16],ht=at.high,lt=at.low;Z=(Z=(Z=Q+st+((q=Y+ct)>>>0>>0?1:0))+it+((q+=nt)>>>0>>0?1:0))+ht+((q+=lt)>>>0>>0?1:0),V.high=Z,V.low=q}var ft,ut=O&U^~O&X,dt=I&K^~I&L,pt=C&E^C&M^E&M,_t=D&R^D&F^R&F,vt=(C>>>28|D<<4)^(C<<30|D>>>2)^(C<<25|D>>>7),yt=(D>>>28|C<<4)^(D<<30|C>>>2)^(D<<25|C>>>7),gt=(O>>>14|I<<18)^(O>>>18|I<<14)^(O<<23|I>>>9),Bt=(I>>>14|O<<18)^(I>>>18|O<<14)^(I<<23|O>>>9),wt=c[T],kt=wt.high,St=wt.low,mt=j+gt+((ft=N+Bt)>>>0>>0?1:0),xt=yt+_t;j=X,N=L,X=U,L=K,U=O,K=I,O=P+(mt=(mt=(mt=mt+ut+((ft=ft+dt)>>>0>>0?1:0))+kt+((ft=ft+St)>>>0>>0?1:0))+Z+((ft=ft+q)>>>0>>0?1:0))+((I=W+ft|0)>>>0>>0?1:0)|0,P=M,W=F,M=E,F=R,E=C,R=D,C=mt+(vt+pt+(xt>>>0>>0?1:0))+((D=ft+xt|0)>>>0>>0?1:0)|0}p=i.low=p+D,i.high=d+C+(p>>>0>>0?1:0),v=n.low=v+R,n.high=_+E+(v>>>0>>0?1:0),g=o.low=g+F,o.high=y+M+(g>>>0>>0?1:0),w=s.low=w+W,s.high=B+P+(w>>>0>>0?1:0),S=h.low=S+I,h.high=k+O+(S>>>0>>0?1:0),x=l.low=x+K,l.high=m+U+(x>>>0>>0?1:0),H=f.low=H+L,f.high=b+X+(H>>>0>>0?1:0),A=u.low=A+N,u.high=z+j+(A>>>0>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[30+(i+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(i+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(h),t.HmacSHA512=e._createHmacHelper(h)}(),function(){var t=l,e=t.x64,r=e.Word,i=e.WordArray,n=t.algo,o=n.SHA512,s=n.SHA384=o.extend({_doReset:function(){this._hash=new i.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var t=o._doFinalize.call(this);return t.sigBytes-=16,t}});t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s)}(),l.lib.Cipher||function(t){var e=l,r=e.lib,i=r.Base,n=r.WordArray,o=r.BufferedBlockAlgorithm,s=e.enc,c=(s.Utf8,s.Base64),a=e.algo.EvpKDF,h=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?B:y}return function(e){return{encrypt:function(r,i,n){return t(i).encrypt(e,r,i,n)},decrypt:function(r,i,n){return t(i).decrypt(e,r,i,n)}}}}()}),f=(r.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),e.mode={}),u=r.BlockCipherMode=i.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),d=f.CBC=function(){var e=u.extend();function r(e,r,i){var n,o=this._iv;o?(n=o,this._iv=t):n=this._prevBlock;for(var s=0;s>>2];t.sigBytes-=e}},_=(r.BlockCipher=h.extend({cfg:h.cfg.extend({mode:d,padding:p}),reset:function(){var t;h.reset.call(this);var e=this.cfg,r=e.iv,i=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=i.createEncryptor:(t=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(i,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),r.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),v=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;return(r?n.create([1398893684,1701076831]).concat(r).concat(e):e).toString(c)},parse:function(t){var e,r=c.parse(t),i=r.words;return 1398893684==i[0]&&1701076831==i[1]&&(e=n.create(i.slice(2,4)),i.splice(0,4),r.sigBytes-=16),_.create({ciphertext:r,salt:e})}},y=r.SerializableCipher=i.extend({cfg:i.extend({format:v}),encrypt:function(t,e,r,i){i=this.cfg.extend(i);var n=t.createEncryptor(r,i),o=n.finalize(e),s=n.cfg;return _.create({ciphertext:o,key:r,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:i.format})},decrypt:function(t,e,r,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),t.createDecryptor(r,i).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),g=(e.kdf={}).OpenSSL={execute:function(t,e,r,i){i||(i=n.random(8));var o=a.create({keySize:e+r}).compute(t,i),s=n.create(o.words.slice(e),4*r);return o.sigBytes=4*e,_.create({key:o,iv:s,salt:i})}},B=r.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:g}),encrypt:function(t,e,r,i){var n=(i=this.cfg.extend(i)).kdf.execute(r,t.keySize,t.ivSize);i.iv=n.iv;var o=y.encrypt.call(this,t,e,n.key,i);return o.mixIn(n),o},decrypt:function(t,e,r,i){i=this.cfg.extend(i),e=this._parse(e,i.format);var n=i.kdf.execute(r,t.keySize,t.ivSize,e.salt);return i.iv=n.iv,y.decrypt.call(this,t,e,n.key,i)}})}(),l.mode.CFB=function(){var t=l.lib.BlockCipherMode.extend();function e(t,e,r,i){var n,o=this._iv;o?(n=o.slice(0),this._iv=void 0):n=this._prevBlock,i.encryptBlock(n,0);for(var s=0;s>>2]|=n<<24-o%4*8,t.sigBytes+=n},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},l.pad.Iso10126={pad:function(t,e){var r=4*e,i=r-t.sigBytes%r;t.concat(l.lib.WordArray.random(i-1)).concat(l.lib.WordArray.create([i<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},l.pad.Iso97971={pad:function(t,e){t.concat(l.lib.WordArray.create([2147483648],1)),l.pad.ZeroPadding.pad(t,e)},unpad:function(t){l.pad.ZeroPadding.unpad(t),t.sigBytes--}},l.mode.OFB=(a=l.lib.BlockCipherMode.extend(),h=a.Encryptor=a.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,n=this._iv,o=this._keystream;n&&(o=this._keystream=n.slice(0),this._iv=void 0),r.encryptBlock(o,0);for(var s=0;s>>8^255&p^99,i[r]=p,n[p]=r;var _=t[r],v=t[_],y=t[v],g=257*t[p]^16843008*p;o[r]=g<<24|g>>>8,s[r]=g<<16|g>>>16,c[r]=g<<8|g>>>24,a[r]=g;g=16843009*y^65537*v^257*_^16843008*r;h[p]=g<<24|g>>>8,f[p]=g<<16|g>>>16,u[p]=g<<8|g>>>24,d[p]=g,r?(r=_^t[t[t[y^_]]],l^=t[t[l]]):r=l=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],_=r.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],s=0;s6&&s%r==4&&(l=i[l>>>24]<<24|i[l>>>16&255]<<16|i[l>>>8&255]<<8|i[255&l]):(l=i[(l=l<<8|l>>>24)>>>24]<<24|i[l>>>16&255]<<16|i[l>>>8&255]<<8|i[255&l],l^=p[s/r|0]<<24),o[s]=o[s-r]^l);for(var c=this._invKeySchedule=[],a=0;a>>24]]^f[i[l>>>16&255]]^u[i[l>>>8&255]]^d[i[255&l]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,o,s,c,a,i)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,h,f,u,d,n);r=t[e+1];t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,i,n,o,s,c){for(var a=this._nRounds,h=t[e]^r[0],l=t[e+1]^r[1],f=t[e+2]^r[2],u=t[e+3]^r[3],d=4,p=1;p>>24]^n[l>>>16&255]^o[f>>>8&255]^s[255&u]^r[d++],v=i[l>>>24]^n[f>>>16&255]^o[u>>>8&255]^s[255&h]^r[d++],y=i[f>>>24]^n[u>>>16&255]^o[h>>>8&255]^s[255&l]^r[d++],g=i[u>>>24]^n[h>>>16&255]^o[l>>>8&255]^s[255&f]^r[d++];h=_,l=v,f=y,u=g}_=(c[h>>>24]<<24|c[l>>>16&255]<<16|c[f>>>8&255]<<8|c[255&u])^r[d++],v=(c[l>>>24]<<24|c[f>>>16&255]<<16|c[u>>>8&255]<<8|c[255&h])^r[d++],y=(c[f>>>24]<<24|c[u>>>16&255]<<16|c[h>>>8&255]<<8|c[255&l])^r[d++],g=(c[u>>>24]<<24|c[h>>>16&255]<<16|c[l>>>8&255]<<8|c[255&f])^r[d++];t[e]=_,t[e+1]=v,t[e+2]=y,t[e+3]=g},keySize:8});t.AES=e._createHelper(_)}(),function(){var t=l,e=t.lib,r=e.WordArray,i=e.BlockCipher,n=t.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],a=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],h=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=n.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],r=0;r<56;r++){var i=o[r]-1;e[r]=t[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var h=n[a]=[],l=c[a];for(r=0;r<24;r++)h[r/6|0]|=e[(s[r]-1+l)%28]<<31-r%6,h[4+(r/6|0)]|=e[28+(s[r+24]-1+l)%28]<<31-r%6;h[0]=h[0]<<1|h[0]>>>31;for(r=1;r<7;r++)h[r]=h[r]>>>4*(r-1)+3;h[7]=h[7]<<5|h[7]>>>27}var f=this._invSubKeys=[];for(r=0;r<16;r++)f[r]=n[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,r){this._lBlock=t[e],this._rBlock=t[e+1],u.call(this,4,252645135),u.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),u.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],o=this._lBlock,s=this._rBlock,c=0,l=0;l<8;l++)c|=a[l][((s^n[l])&h[l])>>>0];this._lBlock=s,this._rBlock=o^c}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,u.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),u.call(this,16,65535),u.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function u(t,e){var r=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=r,this._lBlock^=r<>>t^this._lBlock)&e;this._lBlock^=r,this._rBlock^=r<192.");var e=t.slice(0,2),i=t.length<4?t.slice(0,2):t.slice(2,4),n=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=f.createEncryptor(r.create(e)),this._des2=f.createEncryptor(r.create(i)),this._des3=f.createEncryptor(r.create(n))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=i._createHelper(p)}(),function(){var t=l,e=t.lib.StreamCipher,r=t.algo,i=r.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,r=t.sigBytes,i=this._S=[],n=0;n<256;n++)i[n]=n;n=0;for(var o=0;n<256;n++){var s=n%r,c=e[s>>>2]>>>24-s%4*8&255;o=(o+i[n]+c)%256;var a=i[n];i[n]=i[o],i[o]=a}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=n.call(this)},keySize:8,ivSize:0});function n(){for(var t=this._S,e=this._i,r=this._j,i=0,n=0;n<4;n++){r=(r+t[e=(e+1)%256])%256;var o=t[e];t[e]=t[r],t[r]=o,i|=t[(t[e]+t[r])%256]<<24-8*n}return this._i=e,this._j=r,i}t.RC4=e._createHelper(i);var o=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)n.call(this)}});t.RC4Drop=e._createHelper(o)}(),l.mode.CTRGladman=function(){var t=l.lib.BlockCipherMode.extend();function e(t){if(255==(t>>24&255)){var e=t>>16&255,r=t>>8&255,i=255&t;255===e?(e=0,255===r?(r=0,255===i?i=0:++i):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=i}else t+=1<<24;return t}var r=t.Encryptor=t.extend({processBlock:function(t,r){var i=this._cipher,n=i.blockSize,o=this._iv,s=this._counter;o&&(s=this._counter=o.slice(0),this._iv=void 0),function(t){0===(t[0]=e(t[0]))&&(t[1]=e(t[1]))}(s);var c=s.slice(0);i.encryptBlock(c,0);for(var a=0;a>>24)|4278255360&(t[r]<<24|t[r]>>>8);var i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(r=0;r<4;r++)c.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(e){var o=e.words,s=o[0],a=o[1],h=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=h>>>16|4294901760&l,u=l<<16|65535&h;n[0]^=h,n[1]^=f,n[2]^=l,n[3]^=u,n[4]^=h,n[5]^=f,n[6]^=l,n[7]^=u;for(r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(t,e){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),t[e+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,r=0;r<8;r++)n[r]=e[r];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=t[r]+e[r],s=65535&i,c=i>>>16,a=((s*s>>>17)+s*c>>>15)+c*c,h=((4294901760&i)*i|0)+((65535&i)*i|0);o[r]=a^h}t[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,t[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,t[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,t[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,t[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,t[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,t[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,t[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.Rabbit=e._createHelper(s)}(),l.mode.CTR=function(){var t=l.lib.BlockCipherMode.extend(),e=t.Encryptor=t.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,n=this._iv,o=this._counter;n&&(o=this._counter=n.slice(0),this._iv=void 0);var s=o.slice(0);r.encryptBlock(s,0),o[i-1]=o[i-1]+1|0;for(var c=0;c>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(e){var o=e.words,s=o[0],a=o[1],h=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=h>>>16|4294901760&l,u=l<<16|65535&h;i[0]^=h,i[1]^=f,i[2]^=l,i[3]^=u,i[4]^=h,i[5]^=f,i[6]^=l,i[7]^=u;for(n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(t,e){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),t[e+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,r=0;r<8;r++)n[r]=e[r];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=t[r]+e[r],s=65535&i,c=i>>>16,a=((s*s>>>17)+s*c>>>15)+c*c,h=((4294901760&i)*i|0)+((65535&i)*i|0);o[r]=a^h}t[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,t[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,t[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,t[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,t[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,t[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,t[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,t[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.RabbitLegacy=e._createHelper(s)}(),l.pad.ZeroPadding={pad:function(t,e){var r=4*e;t.clamp(),t.sigBytes+=r-(t.sigBytes%r||r)},unpad:function(t){var e=t.words,r=t.sigBytes-1;for(r=t.sigBytes-1;r>=0;r--)if(e[r>>>2]>>>24-r%4*8&255){t.sigBytes=r+1;break}}},l});
3 |
4 | const $ = new Env("IT之家");
5 | $.userHash = "senku_ithome_userHash";
6 | const code = [
7 | 0,
8 | 1,
9 | 2,
10 | 3,
11 | 256,
12 | 257,
13 | 258,
14 | 259,
15 | 512,
16 | 513,
17 | 514,
18 | 515,
19 | 768,
20 | 769,
21 | 770,
22 | 771,
23 | ];
24 | const now = new Date().getTime();
25 | $.arr = [];
26 | $.result = "";
27 |
28 | !(async () => {
29 | $.CryptoJS = $.isNode() ? require("crypto-js") : CryptoJS;
30 | // code.forEach(async (val) => {
31 | // await sign(val);
32 | // });
33 | await sign();
34 | await signinfo();
35 | await showmsg();
36 | })()
37 | .catch((e) => $.logErr(e))
38 | .finally(() => $.done());
39 |
40 | function sign() {
41 | return new Promise((resolve) => {
42 | const url = {
43 | url: getUrl(),
44 | headers: {
45 | Host: "my.ruanmei.com",
46 | "User-Agent":
47 | "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 ithome/rmsdklevel2/day/7.63",
48 | },
49 | };
50 | $.get(url, (err, resp, data) => {
51 | try {
52 | const res = JSON.parse(data);
53 | if (res.ok === 0) {
54 | $.result = res.msg;
55 | } else if (res.ok === 1) {
56 | $.result = res.title;
57 | } else {
58 | $.result = "未知签到结果,请查看日志";
59 | console.log(data);
60 | }
61 | } catch (e) {
62 | $.logErr(e, resp);
63 | } finally {
64 | resolve();
65 | }
66 | });
67 | });
68 | }
69 |
70 | function signinfo() {
71 | return new Promise((resolve) => {
72 | const userHash = $.getdata($.userHash);
73 | const url = {
74 | url: `https://my.ruanmei.com/api/usersign/getsigninfo?userHash=${userHash}&type=0`,
75 | headers: {},
76 | };
77 | url.headers["User-Agent"] =
78 | "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 ithome/rmsdklevel2/day/7.32";
79 | $.get(url, (err, resp, data) => {
80 | try {
81 | $.signinfo = JSON.parse(data);
82 | } catch (e) {
83 | $.logErr(e, resp);
84 | } finally {
85 | resolve();
86 | }
87 | });
88 | });
89 | }
90 |
91 | function encrypt(str) {
92 | const key = `HCa%Y|7#`;
93 | const keyHex = $.CryptoJS.enc.Utf8.parse(key);
94 | return $.CryptoJS.enc.Base64.parse(
95 | $.CryptoJS.DES.encrypt(str, keyHex, {
96 | mode: $.CryptoJS.mode.ECB,
97 | padding: $.CryptoJS.pad.ZeroPadding,
98 | }).toString()
99 | ).toString($.CryptoJS.enc.Hex);
100 | }
101 |
102 | function showmsg() {
103 | return new Promise((resolve) => {
104 | $.subt = `签到:${$.result}`;
105 | $.desc = [];
106 | if ($.signinfo) {
107 | $.desc.push(
108 | `连续:${$.signinfo.cdays}天,累计:${$.signinfo.mdays}天,金币:${$.signinfo.totalcoin}个`
109 | );
110 | }
111 | $.msg($.name, $.subt, $.desc.join("\n"));
112 | resolve();
113 | });
114 | }
115 |
116 | function gekk(S) {
117 | const Skey =
118 | "hd7%b4f8p9)*fd4h5l6|)123/*-+!#$@%^*()_+?>?njidfds[]rfbcvnb3rz/ird|opqqyh487874515/%90hggigadfihklhkopjj`b3hsdfdsf84215456fi15451%q(#@Fzd795hn^Ccl$vK^L%#w$^yr%ETvX#0TaPSRm5)OeG)^fQnn6^%^UTtJI#3EZ@p6^Rf$^!O$(jnkOiBjn3#inhOQQ!aTX8R)9O%#o3zCVxo3tLyVorwYwA^$%^b9Yy$opSEAOOlFBsS^5d^HoF%tJ$dx%3)^q^c^$al%b4I)QHq^#^AlcK^KZFYf81#bL$n@$%j^H(%m^";
119 | const timeStemp = new Date(now).getTime();
120 | const today = new Date(now).getDate();
121 | const Value1 = Math.round(timeStemp / 50000) * today * 3;
122 | if (S === 3) {
123 | return (
124 | Skey[parseInt((Value1 % 10000) / 1000) * today] +
125 | Skey[parseInt((Value1 % 1000) / 100) * today] +
126 | Skey[parseInt((Value1 % 100) / 10) * today]
127 | );
128 | } else if (S === 8) {
129 | return (
130 | Skey[parseInt((Value1 % 100000000) / 10000000) * today] +
131 | Skey[parseInt((Value1 % 10000000) / 1000000) * today] +
132 | Skey[parseInt((Value1 % 1000000) / 100000) * today] +
133 | Skey[parseInt((Value1 % 100000) / 10000) * today] +
134 | Skey[parseInt((Value1 % 10000) / 1000) * today] +
135 | Skey[parseInt((Value1 % 1000) / 100) * today] +
136 | Skey[parseInt((Value1 % 100) / 10) * today] +
137 | Skey[parseInt(Value1 % 10) * today]
138 | );
139 | }
140 | }
141 |
142 | function gnekk() {
143 | const base = CryptoJS.TripleDES.encrypt(
144 | CryptoJS.enc.Utf8.parse(gekk(3)),
145 | CryptoJS.enc.Utf8.parse(gekk(8)),
146 | {
147 | mode: CryptoJS.mode.ECB, // 加密模式
148 | padding: CryptoJS.pad.ZeroPadding,
149 | }
150 | ).toString();
151 | const text = "k" + CryptoJS.enc.Base64.parse(base).toString(CryptoJS.enc.Hex);
152 | return text;
153 | }
154 |
155 | function geKsk() {
156 | const base = CryptoJS.TripleDES.encrypt(
157 | CryptoJS.enc.Utf8.parse($.time("yyyy-MM-dd HH:mm:ss", now)),
158 | CryptoJS.enc.Utf8.parse(gekk(8)),
159 | {
160 | mode: CryptoJS.mode.ECB, // 加密模式
161 | padding: CryptoJS.pad.ZeroPadding,
162 | }
163 | ).toString();
164 | const text = CryptoJS.enc.Base64.parse(base).toString(CryptoJS.enc.Hex);
165 | return text;
166 | }
167 |
168 | function getUrl() {
169 | const userHash = $.getdata($.userHash);
170 | return `https://my.ruanmei.com/api/usersign/sign?userHash=${userHash}&type=0×tamp=${now}&${gnekk()}=${geKsk()}`;
171 | }
172 |
173 | // prettier-ignore
174 | function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)}
--------------------------------------------------------------------------------