forked from enkiger/Rewrite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchatai.js
51 lines (42 loc) · 1.91 KB
/
chatai.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/****************************************
项目名称:Chat AI:中文-人工智能聊天
下载工具:https://t.cn/A6p1ANqR
脚本作者:chxm1023
电报频道:https://t.me/chxm1023
使用声明:⚠️仅供参考,🈲转载与售卖!
*****************************************
[rewrite_local]
^https?:\/\/api\.revenuecat\.com\/.+\/(receipts$|subscribers\/?(.*?)*$) url script-response-body https://raw.githubusercontent.com/chxm1023/Rewrite/main/chatai.js
^https?:\/\/api\.revenuecat\.com\/.+\/(receipts$|subscribers\/?(.*?)*$) url script-request-header https://raw.githubusercontent.com/chxm1023/Rewrite/main/chatai.js
[mitm]
hostname = api.revenuecat.com
*************************************/
const chxm1023 = {};
const chxm1024 = JSON.parse(typeof $response != "undefined" && $response.body || null);const app = 'cm';const list = {'cm':{name: 'Advanced', id: 'com.palligroup.gpt3.yearlyyy'}};
const data = {
"Author": "chxm1023",
"Telegram" : "https://t.me/chxm1023",
"warning": "仅供学习,禁止转载或售卖",
"original_purchase_date": "2022-09-09T09:09:09Z",
"purchase_date": "2022-09-09T09:09:09Z",
"expires_date": "2099-09-09T09:09:09Z",
"ownership_type": "PURCHASED"
};
if (typeof $response == "undefined") {
delete $request.headers["x-revenuecat-etag"];
delete $request.headers["X-RevenueCat-ETag"];
chxm1023.headers = $request.headers;
} else if (chxm1024 && chxm1024.subscriber) {
chxm1024.subscriber.subscriptions = chxm1024.subscriber.subscriptions || {};
chxm1024.subscriber.entitlement = chxm1024.subscriber.entitlement || {};
for (const i in list) {
if (new RegExp(`^${i}`, `i`).test(app)) {
chxm1024.subscriber.subscriptions[list[i].id] = data;
chxm1024.subscriber.entitlements[list[i].name] = JSON.parse(JSON.stringify(data));
chxm1024.subscriber.entitlements[list[i].name].product_identifier = list[i].id;
break;
}
}
chxm1023.body = JSON.stringify(chxm1024);
}
$done(chxm1023);