Last active 1751449070

fix.js Raw
1try {
2 let body = JSON.parse($response.body);
3 const secondsToSubtract = 60 * 60 * 24 * 18200; // ~49.86 năm
4 const now = Math.floor(Date.now() / 1000);
5
6 if (body?.timestamp) {
7 body.timestamp = Number(now ?? body.timestamp) - secondsToSubtract;
8 }
9 $done({ body: JSON.stringify(body) });
10} catch (e) {
11 $done({});
12}
now.js Raw
1try {
2 let body = JSON.parse($response.body);
3
4 // Lấy timestamp hiện tại theo giờ hệ thống (UTC, tính theo giây)
5const now = Math.floor(Date.now() / 1000);
6
7 if (body?.timestamp) {
8 body.now = now;
9 body.timestamp = now;
10 }
11
12 $done({ body: JSON.stringify(body) });
13} catch (e) {
14 $done({});
15}
timezone.module Raw
1#!name=Timezone Shift
2#!homepage=https://f97.xyz
3#!author=f97
4#!desc=Adjust TimezoneDB timestamp by subtracting ~50 years
5
6[Script]
7TimezoneDB=type=http-response,pattern=timezonedb,requires-body=1,script-path=https://demo.opengist.io/f97/cfa7470912c74cae8834bbd590f86666/raw/HEAD/with_call_count.js
8
9[MITM]
10hostname=%APPEND% api.timezonedb.com
with_call_count.js Raw
1try {
2 const body = JSON.parse($response.body);
3 const YEARS_TO_SUBTRACT = 60 * 60 * 24 * 18200; // ~49.86 years
4 const TWO_HOURS = 7200; // 2 hours in seconds
5 const now = Math.floor(Date.now() / 1000);
6
7 // Get and increment call count
8 let callCount = parseInt($persistentStore.read("r26_call_count") || "0") + 1;
9 $persistentStore.write(callCount.toString(), "r26_call_count");
10
11 // Update timestamp if exists
12 if (body?.timestamp) {
13 body.timestamp = now - YEARS_TO_SUBTRACT + (callCount * TWO_HOURS);
14 }
15
16 $done({ body: JSON.stringify(body) });
17} catch (error) {
18 $done({});
19}