dibosockets 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/WAProto/WAProto.proto +1013 -169
- package/lib/Api/Internet/growagarden.js +28 -0
- package/lib/Api/creator.json +13 -0
- package/lib/Api/downloader/tiktokdownload.js +132 -0
- package/lib/Api/index.js +38 -0
- package/lib/Api/nsfw/loli.js +79 -0
- package/lib/Api/stalker/githubstalk.js +46 -0
- package/lib/Api/stalker/stalkroblox.js +94 -0
- package/lib/Api/stalker/tiktokstalk.js +68 -0
- package/lib/Api/tools/ssweb.js +38 -0
- package/lib/Defaults/baileys-version.json +1 -1
- package/lib/Defaults/index.js +50 -34
- package/lib/Defaults/phonenumber_mcc.json +223 -0
- package/lib/Socket/RHandler.js +158 -240
- package/lib/Socket/business.js +8 -2
- package/lib/Socket/chats.js +371 -142
- package/lib/Socket/communities.js +441 -0
- package/lib/Socket/index.js +43 -10
- package/lib/Socket/messages-recv.js +15 -4
- package/lib/Socket/messages-send.js +13 -35
- package/lib/Socket/newsletter.js +107 -124
- package/lib/Socket/socket.js +35 -23
- package/lib/Store/make-in-memory-store.js +1 -1
- package/lib/Types/Newsletter.js +18 -38
- package/lib/Utils/async-iterable.js +41 -0
- package/lib/Utils/baileys-event-stream.js +1 -1
- package/lib/Utils/browser-utils.js +35 -0
- package/lib/Utils/event-buffer.js +2 -2
- package/lib/Utils/generics.js +4 -0
- package/lib/Utils/index.js +3 -3
- package/lib/Utils/message-retry-manager.js +128 -0
- package/lib/Utils/messages-media.js +88 -49
- package/lib/Utils/messages.js +91 -16
- package/lib/Utils/process-message.js +19 -0
- package/lib/Utils/resolveJid.js +52 -0
- package/lib/Utils/use-multi-file-auth-state.js +0 -3
- package/lib/Utils/validate-connection.js +77 -21
- package/lib/WABinary/jid-utils.js +3 -1
- package/lib/index.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const { creator: CREATOR } = require("../creator.json");
|
|
2
|
+
|
|
3
|
+
const growagarden = async () => {
|
|
4
|
+
try {
|
|
5
|
+
const res = await fetch("https://gagstock.gleeze.com/grow-a-garden");
|
|
6
|
+
if (!res.ok) {
|
|
7
|
+
throw new Error("@rexxhayanasi/elaina-baileys API Grow A Garden gagal mengambil data");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const json = await res.json();
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
creator: CREATOR,
|
|
14
|
+
status: json.status,
|
|
15
|
+
updated_at: json.updated_at,
|
|
16
|
+
data: json.data
|
|
17
|
+
};
|
|
18
|
+
} catch (err) {
|
|
19
|
+
return {
|
|
20
|
+
creator: CREATOR,
|
|
21
|
+
error: err.message,
|
|
22
|
+
status: 500
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
module.exports = growagarden;
|
|
28
|
+
module.exports.default = growagarden;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"creator": {
|
|
3
|
+
"name": "RexxHayanasi",
|
|
4
|
+
"username": "rexxhayanasi",
|
|
5
|
+
"github": "https://github.com/rexxhayanasi",
|
|
6
|
+
"instagram": "https://instagram.com/rexxhayanasi",
|
|
7
|
+
"website": "https://rexxhayanasi.dev",
|
|
8
|
+
"contact": {
|
|
9
|
+
"whatsapp": "https://wa.me/6285282530851",
|
|
10
|
+
"email": "rexxhayanasi@gmail.com"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
const { creator: CREATOR } = require("../creator.json");
|
|
2
|
+
|
|
3
|
+
// === Proxy download file ===
|
|
4
|
+
async function proxyFile(fileUrl, filename, mimeType) {
|
|
5
|
+
const resp = await fetch(fileUrl);
|
|
6
|
+
const buffer = Buffer.from(await resp.arrayBuffer());
|
|
7
|
+
|
|
8
|
+
return {
|
|
9
|
+
statusCode: 200,
|
|
10
|
+
headers: {
|
|
11
|
+
"Content-Type": mimeType,
|
|
12
|
+
"Content-Disposition": `attachment; filename="${filename}"`,
|
|
13
|
+
"Content-Length": buffer.length
|
|
14
|
+
},
|
|
15
|
+
body: buffer.toString("base64"),
|
|
16
|
+
isBase64Encoded: true
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// === Ambil image slide ===
|
|
21
|
+
async function fetchImages(url) {
|
|
22
|
+
try {
|
|
23
|
+
const apiUrl = `https://tikwm.com/api/?url=${encodeURIComponent(url)}`;
|
|
24
|
+
const res = await fetch(apiUrl).then(r => r.json());
|
|
25
|
+
|
|
26
|
+
if (res.code !== 0 || !res.data?.images || res.data.images.length === 0) {
|
|
27
|
+
return {
|
|
28
|
+
statusCode: 404,
|
|
29
|
+
headers: { "Content-Type": "application/json" },
|
|
30
|
+
body: JSON.stringify({
|
|
31
|
+
status: false,
|
|
32
|
+
message: "Gambar tidak ditemukan",
|
|
33
|
+
creator: CREATOR
|
|
34
|
+
}, null, 2)
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
statusCode: 200,
|
|
40
|
+
headers: { "Content-Type": "application/json" },
|
|
41
|
+
body: JSON.stringify({
|
|
42
|
+
status: true,
|
|
43
|
+
mode: "image",
|
|
44
|
+
creator: CREATOR,
|
|
45
|
+
images: res.data.images
|
|
46
|
+
}, null, 2)
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
} catch (e) {
|
|
50
|
+
return {
|
|
51
|
+
statusCode: 500,
|
|
52
|
+
headers: { "Content-Type": "application/json" },
|
|
53
|
+
body: JSON.stringify({
|
|
54
|
+
status: false,
|
|
55
|
+
message: "Terjadi kesalahan saat mengambil data",
|
|
56
|
+
creator: CREATOR,
|
|
57
|
+
error: e.message
|
|
58
|
+
}, null, 2)
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function tiktokdownload(params = {}) {
|
|
64
|
+
try {
|
|
65
|
+
const { url, download } = params;
|
|
66
|
+
|
|
67
|
+
if (!url) {
|
|
68
|
+
return {
|
|
69
|
+
status: false,
|
|
70
|
+
message: "Masukkan parameter ?url=",
|
|
71
|
+
creator: CREATOR
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const apiRes = await fetch(
|
|
76
|
+
`https://www.tikwm.com/api?url=${encodeURIComponent(url)}&hd=1`,
|
|
77
|
+
{ method: "POST" }
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const json = await apiRes.json();
|
|
81
|
+
const result = json?.data;
|
|
82
|
+
|
|
83
|
+
// === Download langsung
|
|
84
|
+
if (download && result) {
|
|
85
|
+
if (download === "video" && (result.hdplay || result.play)) {
|
|
86
|
+
return await proxyFile(result.hdplay || result.play, "tiktok.mp4", "video/mp4");
|
|
87
|
+
}
|
|
88
|
+
if (download === "audio" && result.music) {
|
|
89
|
+
return await proxyFile(result.music, "tiktok.mp3", "audio/mpeg");
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Video atau slide
|
|
94
|
+
if (result?.play || result?.hdplay) {
|
|
95
|
+
// Jika slide
|
|
96
|
+
if (Array.isArray(result.images) && result.images.length > 0) {
|
|
97
|
+
return await fetchImages(url);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
status: true,
|
|
102
|
+
mode: "video",
|
|
103
|
+
creator: CREATOR,
|
|
104
|
+
author: {
|
|
105
|
+
unique_id: result.author.unique_id,
|
|
106
|
+
nickname: result.author.nickname
|
|
107
|
+
},
|
|
108
|
+
duration: result.duration,
|
|
109
|
+
cover: result.cover,
|
|
110
|
+
music: result.music,
|
|
111
|
+
play: result.play,
|
|
112
|
+
wmplay: result.wmplay,
|
|
113
|
+
hdplay: result.hdplay
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// fallback slide
|
|
118
|
+
return await fetchImages(url);
|
|
119
|
+
|
|
120
|
+
} catch (err) {
|
|
121
|
+
return {
|
|
122
|
+
status: false,
|
|
123
|
+
message: "Server error",
|
|
124
|
+
creator: CREATOR,
|
|
125
|
+
error: String(err)
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// *** FIX EKSPOR ***
|
|
131
|
+
module.exports = tiktokdownload;
|
|
132
|
+
module.exports.default = tiktokdownload;
|
package/lib/Api/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.githubstalk =
|
|
7
|
+
exports.stalkroblox =
|
|
8
|
+
exports.ttstalk =
|
|
9
|
+
exports.growagarden =
|
|
10
|
+
exports.ttdl =
|
|
11
|
+
exports.loli =
|
|
12
|
+
exports.ssweb =
|
|
13
|
+
void 0;
|
|
14
|
+
|
|
15
|
+
// Bagian Stalker
|
|
16
|
+
const githubstalk_1 = __importDefault(require("./stalker/githubstalk"));
|
|
17
|
+
exports.githubstalk = githubstalk_1.default;
|
|
18
|
+
|
|
19
|
+
const stalkroblox_1 = __importDefault(require("./stalker/stalkroblox"));
|
|
20
|
+
exports.stalkroblox = stalkroblox_1.default;
|
|
21
|
+
|
|
22
|
+
const ttstalk_1 = __importDefault(require("./stalker/tiktokstalk"));
|
|
23
|
+
exports.ttstalk = ttstalk_1.default;
|
|
24
|
+
|
|
25
|
+
const growagarden_1 = __importDefault(require("./Internet/growagarden"));
|
|
26
|
+
exports.growagarden = growagarden_1.default;
|
|
27
|
+
|
|
28
|
+
// Bagian Downloader
|
|
29
|
+
const ttdl_1 = __importDefault(require("./downloader/tiktokdownload"));
|
|
30
|
+
exports.ttdl = ttdl_1.default;
|
|
31
|
+
|
|
32
|
+
// Bagian NSFW
|
|
33
|
+
const loli_1 = __importDefault(require("./nsfw/loli"));
|
|
34
|
+
exports.loli = loli_1.default;
|
|
35
|
+
|
|
36
|
+
// Bagian Tools
|
|
37
|
+
const ssweb_1 = __importDefault(require("./tools/ssweb"));
|
|
38
|
+
exports.ssweb = ssweb_1.default;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
const { creator: CREATOR } = require("../creator.json");
|
|
2
|
+
|
|
3
|
+
async function loli() {
|
|
4
|
+
try {
|
|
5
|
+
const randomPage = Math.floor(Math.random() * 200) + 1;
|
|
6
|
+
const konachanUrl = `https://konachan.com/post.json?tags=loli&limit=50&page=${randomPage}`;
|
|
7
|
+
|
|
8
|
+
const proxyList = [
|
|
9
|
+
`https://corsproxy.io/?${encodeURIComponent(konachanUrl)}`,
|
|
10
|
+
`https://api.codetabs.com/v1/proxy?quest=${encodeURIComponent(konachanUrl)}`,
|
|
11
|
+
`https://cors-anywhere.herokuapp.com/${konachanUrl}`
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
const parsePosts = async (url) => {
|
|
15
|
+
const r = await fetch(url);
|
|
16
|
+
if (!r.ok) throw new Error();
|
|
17
|
+
if (url.includes("codetabs.com")) {
|
|
18
|
+
const t = await r.text();
|
|
19
|
+
return JSON.parse(t);
|
|
20
|
+
}
|
|
21
|
+
return await r.json();
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const posts = await Promise.any(proxyList.map(parsePosts));
|
|
25
|
+
if (!posts || posts.length === 0) {
|
|
26
|
+
return { status: false, creator: CREATOR, images: [] };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const randomPost = posts[Math.floor(Math.random() * posts.length)];
|
|
30
|
+
const imageUrl = randomPost.file_url;
|
|
31
|
+
|
|
32
|
+
const imageProxyList = [
|
|
33
|
+
`https://corsproxy.io/?${encodeURIComponent(imageUrl)}`,
|
|
34
|
+
`https://api.codetabs.com/v1/proxy?quest=${encodeURIComponent(imageUrl)}`,
|
|
35
|
+
`https://cors-anywhere.herokuapp.com/${imageUrl}`
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const getImageBuffer = async (url) => {
|
|
39
|
+
const r = await fetch(url);
|
|
40
|
+
if (!r.ok) throw new Error();
|
|
41
|
+
const ab = await r.arrayBuffer();
|
|
42
|
+
return Buffer.from(ab);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const imageBuffer = await Promise.any(imageProxyList.map(getImageBuffer));
|
|
46
|
+
|
|
47
|
+
const formData = new FormData();
|
|
48
|
+
formData.append("reqtype", "fileupload");
|
|
49
|
+
formData.append("fileToUpload", new Blob([imageBuffer]), "image.jpg");
|
|
50
|
+
|
|
51
|
+
const uploadRes = await fetch("https://catbox.moe/user/api.php", {
|
|
52
|
+
method: "POST",
|
|
53
|
+
body: formData
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const catboxUrl = (await uploadRes.text()).trim();
|
|
57
|
+
|
|
58
|
+
if (!catboxUrl.startsWith("https://")) {
|
|
59
|
+
return { status: false, creator: CREATOR, images: [] };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
status: true,
|
|
64
|
+
images: [catboxUrl],
|
|
65
|
+
creator: CREATOR
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
} catch (err) {
|
|
69
|
+
return {
|
|
70
|
+
status: false,
|
|
71
|
+
creator: CREATOR,
|
|
72
|
+
images: [],
|
|
73
|
+
error: err.message
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
module.exports = loli;
|
|
79
|
+
module.exports.default = loli;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const { creator: CREATOR } = require("../creator.json");
|
|
2
|
+
|
|
3
|
+
const githubstalk = async (user) => {
|
|
4
|
+
if (!user) {
|
|
5
|
+
return {
|
|
6
|
+
error: "Missing parameter Username",
|
|
7
|
+
creator: CREATOR,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const url = `https://api.github.com/users/${user}`;
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
const response = await fetch(url, {
|
|
15
|
+
headers: {
|
|
16
|
+
"User-Agent": "Mozilla/5.0",
|
|
17
|
+
Accept: "application/vnd.github+json",
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
if (!response.ok) {
|
|
22
|
+
return {
|
|
23
|
+
error: response.status === 404 ? "User not found" : "GitHub API request failed",
|
|
24
|
+
status: response.status,
|
|
25
|
+
creator: CREATOR,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const data = await response.json();
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
success: true,
|
|
33
|
+
user: data,
|
|
34
|
+
creator: CREATOR,
|
|
35
|
+
};
|
|
36
|
+
} catch (err) {
|
|
37
|
+
return {
|
|
38
|
+
error: err.message || "GitHub API request failed",
|
|
39
|
+
status: 500,
|
|
40
|
+
creator: CREATOR,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
module.exports = githubstalk;
|
|
46
|
+
module.exports.default = githubstalk;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
const { creator: CREATOR } = require("../creator.json");
|
|
2
|
+
|
|
3
|
+
const postJson = async (url, body) => {
|
|
4
|
+
try {
|
|
5
|
+
const res = await fetch(url, {
|
|
6
|
+
method: "POST",
|
|
7
|
+
headers: { "Content-Type": "application/json" },
|
|
8
|
+
body: JSON.stringify(body)
|
|
9
|
+
});
|
|
10
|
+
if (!res.ok) return null;
|
|
11
|
+
return res.json();
|
|
12
|
+
} catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const safeFetchJson = async (url) => {
|
|
18
|
+
try {
|
|
19
|
+
const res = await fetch(url);
|
|
20
|
+
if (!res.ok) return null;
|
|
21
|
+
return res.json();
|
|
22
|
+
} catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const stalkroblox = async (username) => {
|
|
28
|
+
if (!username) {
|
|
29
|
+
return {
|
|
30
|
+
error: "Missing parameter ?username=",
|
|
31
|
+
creator: CREATOR
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const searchData = await postJson(
|
|
36
|
+
"https://users.roblox.com/v1/usernames/users",
|
|
37
|
+
{ usernames: [username], excludeBannedUsers: true }
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const userData = searchData?.data?.[0];
|
|
41
|
+
if (!userData) {
|
|
42
|
+
return {
|
|
43
|
+
error: `User "${username}" not found`,
|
|
44
|
+
creator: CREATOR
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const userId = userData.id;
|
|
49
|
+
|
|
50
|
+
const [
|
|
51
|
+
thumbnail,
|
|
52
|
+
info,
|
|
53
|
+
friends,
|
|
54
|
+
followers,
|
|
55
|
+
following,
|
|
56
|
+
groups,
|
|
57
|
+
badges
|
|
58
|
+
] = await Promise.all([
|
|
59
|
+
safeFetchJson(`https://thumbnails.roblox.com/v1/users/avatar?userIds=${userId}&size=420x420&format=Png&isCircular=false`),
|
|
60
|
+
safeFetchJson(`https://users.roblox.com/v1/users/${userId}`),
|
|
61
|
+
safeFetchJson(`https://friends.roblox.com/v1/users/${userId}/friends/count`),
|
|
62
|
+
safeFetchJson(`https://friends.roblox.com/v1/users/${userId}/followers/count`),
|
|
63
|
+
safeFetchJson(`https://friends.roblox.com/v1/users/${userId}/followings/count`),
|
|
64
|
+
safeFetchJson(`https://groups.roblox.com/v1/users/${userId}/groups/roles`),
|
|
65
|
+
safeFetchJson(`https://badges.roblox.com/v1/users/${userId}/badges?limit=25&sortOrder=Asc`)
|
|
66
|
+
]);
|
|
67
|
+
|
|
68
|
+
const data = {
|
|
69
|
+
username: userData.name,
|
|
70
|
+
displayName: userData.displayName,
|
|
71
|
+
userId,
|
|
72
|
+
profilePicUrl: thumbnail?.data?.[0]?.imageUrl || null,
|
|
73
|
+
description: info?.description || null,
|
|
74
|
+
joinDate: info?.created || null,
|
|
75
|
+
friendsCount: friends?.count ?? 0,
|
|
76
|
+
followersCount: followers?.count ?? 0,
|
|
77
|
+
followingCount: following?.count ?? 0,
|
|
78
|
+
groups: Array.isArray(groups?.data)
|
|
79
|
+
? groups.data.map(g => g.group?.name).filter(Boolean)
|
|
80
|
+
: [],
|
|
81
|
+
badges: Array.isArray(badges?.data)
|
|
82
|
+
? badges.data.map(b => b.name)
|
|
83
|
+
: []
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
success: true,
|
|
88
|
+
data,
|
|
89
|
+
creator: CREATOR
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
module.exports = stalkroblox;
|
|
94
|
+
module.exports.default = stalkroblox;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const { creator: CREATOR } = require("../creator.json");
|
|
2
|
+
const cheerio = require("cheerio");
|
|
3
|
+
|
|
4
|
+
async function ttstalk(username) {
|
|
5
|
+
try {
|
|
6
|
+
const url = `https://www.tiktok.com/@${username}?_t=ZS-8tHANz7ieoS&_r=1`;
|
|
7
|
+
|
|
8
|
+
const response = await fetch(url, {
|
|
9
|
+
headers: {
|
|
10
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const html = await response.text();
|
|
15
|
+
const $ = cheerio.load(html);
|
|
16
|
+
|
|
17
|
+
const scriptData = $('#__UNIVERSAL_DATA_FOR_REHYDRATION__').html();
|
|
18
|
+
if (!scriptData) {
|
|
19
|
+
return {
|
|
20
|
+
status: false,
|
|
21
|
+
message: "User tidak ditemukan atau data tidak tersedia."
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const parsedData = JSON.parse(scriptData);
|
|
26
|
+
const userDetail = parsedData.__DEFAULT_SCOPE__?.["webapp.user-detail"];
|
|
27
|
+
|
|
28
|
+
if (!userDetail) {
|
|
29
|
+
return {
|
|
30
|
+
status: false,
|
|
31
|
+
message: "User tidak ditemukan atau data tidak tersedia."
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const userInfo = userDetail.userInfo?.user;
|
|
36
|
+
const stats = userDetail.userInfo?.stats;
|
|
37
|
+
|
|
38
|
+
const hasil = {
|
|
39
|
+
id: userInfo?.id || null,
|
|
40
|
+
username: userInfo?.uniqueId || null,
|
|
41
|
+
nama: userInfo?.nickname || null,
|
|
42
|
+
avatar: userInfo?.avatarLarger || null,
|
|
43
|
+
bio: userInfo?.signature || null,
|
|
44
|
+
region: userInfo?.region || "Tidak diketahui",
|
|
45
|
+
verifikasi: userInfo?.verified || false,
|
|
46
|
+
totalfollowers: stats?.followerCount || 0,
|
|
47
|
+
totalmengikuti: stats?.followingCount || 0,
|
|
48
|
+
totaldisukai: stats?.heart || 0,
|
|
49
|
+
totalvideo: stats?.videoCount || 0,
|
|
50
|
+
totalteman: stats?.friendCount || 0
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
status: true,
|
|
55
|
+
creator: CREATOR,
|
|
56
|
+
results: hasil
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
} catch (error) {
|
|
60
|
+
return {
|
|
61
|
+
status: false,
|
|
62
|
+
message: error.message || "Terjadi kesalahan saat mengambil data."
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
module.exports = ttstalk;
|
|
68
|
+
module.exports.default = ttstalk;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
async function ssweb(url = "", full = false, type = "desktop") {
|
|
2
|
+
type = type.toLowerCase();
|
|
3
|
+
if (!["desktop", "tablet", "phone"].includes(type)) type = "desktop";
|
|
4
|
+
|
|
5
|
+
const form = new URLSearchParams();
|
|
6
|
+
form.append("url", url);
|
|
7
|
+
form.append("device", type);
|
|
8
|
+
if (!!full) form.append("full", "on");
|
|
9
|
+
form.append("cacheLimit", 0);
|
|
10
|
+
|
|
11
|
+
const res = await fetch("https://www.screenshotmachine.com/capture.php", {
|
|
12
|
+
method: "POST",
|
|
13
|
+
body: form,
|
|
14
|
+
headers: {
|
|
15
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const cookies = res.headers.get("set-cookie");
|
|
20
|
+
const json = await res.json();
|
|
21
|
+
|
|
22
|
+
if (!json.link) {
|
|
23
|
+
throw new Error("Gagal mendapatkan link screenshot.");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
const imgRes = await fetch("https://www.screenshotmachine.com/" + json.link, {
|
|
28
|
+
headers: {
|
|
29
|
+
cookie: cookies || "",
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const arrayBuf = await imgRes.arrayBuffer();
|
|
34
|
+
return Buffer.from(arrayBuf);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
module.exports = ssweb;
|
|
38
|
+
module.exports.default = ssweb;
|