forked from ihaoljy/Rewrite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DVD.js
76 lines (69 loc) · 2.46 KB
/
DVD.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*************************************
项目名称:DVD相机
软件版本:1.10
下载地址:https://is.gd/njnoLp
使用声明:⚠️仅供参考,🈲️转载与售卖!
**************************************
[rewrite_local]
^https?:\/\/buy\.itunes\.apple\.com\/verifyReceipt$ url script-response-body https://raw.githubusercontent.com/Yu9191/Rewrite/main/DVD.js
[mitm]
hostname = buy.itunes.apple.com
*************************************/
var anni = {};
var anni01 = JSON.parse(typeof $response != "undefined" && $response.body || null);
var headers = {};
for (var key in $request.headers) {
const reg = /^[a-z]+$/;
if (key === "User-Agent" && !reg.test(key)) {
var lowerkey = key.toLowerCase();
$request.headers[lowerkey] = $request.headers[key];
delete $request.headers[key];
}
}
var UA = $request.headers['user-agent'];
var uaProductMapping = {
'DVDCam': {product_id: 'Pro_Subscription_Yearly'},
};
var receipt = {
"quantity": "1",
"purchase_date_ms": "1686776705000",
"expires_date": "2099-12-31 05:05:05 Etc\/GMT",
"expires_date_pst": "2099-12-31 05:05:05 America\/Los_Angeles",
"is_in_intro_offer_period": "false",
"transaction_id": "999999999999999",
"is_trial_period": "false",
"original_transaction_id": "999999999999999",
"purchase_date": "2023-06-15 05:05:05 Etc\/GMT",
"product_id": "888888888888888",
"original_purchase_date_pst": "2023-06-15 05:05:05 America\/Los_Angeles",
"in_app_ownership_type": "PURCHASED",
"subscription_group_identifier": "20877951",
"original_purchase_date_ms": "1686776705000",
"web_order_line_item_id": "999999999999999",
"expires_date_ms": "4102347905000",
"purchase_date_pst": "2023-06-15 05:05:05 America\/Los_Angeles",
"original_purchase_date": "2023-06-15 05:05:05 Etc\/GMT"
}
var renewal = {
"expiration_intent": "1",
"product_id": "888888888888888",
"is_in_billing_retry_period": "0",
"auto_renew_product_id": "888888888888888",
"original_transaction_id": "999999999999999",
"auto_renew_status": "0"
}
for (var uaKey in uaProductMapping) {
if (UA && UA.includes(uaKey)) {
var productInfo = uaProductMapping[uaKey];
var product_id = productInfo.product_id;
receipt.product_id = product_id;
renewal.product_id = product_id;
renewal.auto_renew_product_id = product_id;
anni01.receipt.in_app = [receipt];
anni01.latest_receipt_info = [receipt];
anni.pending_renewal_info = [renewal];
break;
}
}
anni = anni01;
$done({ body: JSON.stringify(anni) });