@ubedsockets/baileys 1.0.0 → 1.1.0
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/lib/Utils/Tiktok.js +64 -0
- package/lib/index.js +2 -2
- package/package.json +4 -4
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Scraper TikTok untuk @ubedsockets/baileys
|
|
5
|
+
* @param {string} url - Link video atau slide TikTok
|
|
6
|
+
* @returns {Promise<Object>} Data hasil scrape
|
|
7
|
+
*/
|
|
8
|
+
async function tiktok(url) {
|
|
9
|
+
if (!url) throw new Error("URL tidak boleh kosong.");
|
|
10
|
+
|
|
11
|
+
const apiUrl = `https://api.vreden.my.id/api/v1/download/tiktok?url=${encodeURIComponent(url)}`;
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
const { data } = await axios.get(apiUrl);
|
|
15
|
+
|
|
16
|
+
if (!data.status || !data.result) {
|
|
17
|
+
throw new Error("Gagal mengambil data dari provider API.");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const res = data.result;
|
|
21
|
+
|
|
22
|
+
// Memetakan ulang agar response lebih bersih tapi tetap lengkap
|
|
23
|
+
return {
|
|
24
|
+
status: true,
|
|
25
|
+
type: res.data.some(v => v.type === "photo") ? 'slideshow' : 'video',
|
|
26
|
+
title: res.title || '-',
|
|
27
|
+
metadata: {
|
|
28
|
+
region: res.region,
|
|
29
|
+
taken_at: res.taken_at,
|
|
30
|
+
author: {
|
|
31
|
+
username: res.author.nickname,
|
|
32
|
+
fullname: res.author.fullname,
|
|
33
|
+
avatar: res.author.avatar
|
|
34
|
+
},
|
|
35
|
+
stats: {
|
|
36
|
+
views: res.stats.views,
|
|
37
|
+
likes: res.stats.likes,
|
|
38
|
+
comment: res.stats.comment,
|
|
39
|
+
share: res.stats.share,
|
|
40
|
+
download: res.stats.download
|
|
41
|
+
},
|
|
42
|
+
music: {
|
|
43
|
+
title: res.music_info.title,
|
|
44
|
+
author: res.music_info.author,
|
|
45
|
+
url: res.music_info.url
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
// Filter link download
|
|
49
|
+
download: {
|
|
50
|
+
video: res.data.find(v => v.type === "nowatermark")?.url || null,
|
|
51
|
+
watermark: res.data.find(v => v.type === "watermark")?.url || null,
|
|
52
|
+
photos: res.data.filter(v => v.type === "photo").map(v => v.url) || []
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
} catch (error) {
|
|
56
|
+
return {
|
|
57
|
+
status: false,
|
|
58
|
+
message: error.message
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Export fungsi agar bisa di-require langsung
|
|
64
|
+
module.exports = tiktok;
|
package/lib/index.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
const chalk = require('chalk');
|
|
4
4
|
const gradient = require("gradient-string");
|
|
5
5
|
|
|
6
|
-
const thanks = "terimakasih telah menggunakan @
|
|
7
|
-
const vyzen = "©
|
|
6
|
+
const thanks = "terimakasih telah menggunakan @ubedsockets/baileys";
|
|
7
|
+
const vyzen = "©ubedsockets/baileys";
|
|
8
8
|
|
|
9
9
|
const thanksColor = [
|
|
10
10
|
"#A2D2FF",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ubedsockets/baileys",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "@ubedsockets/baileys,
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "@ubedsockets/baileys,baileys untuk bot WhatsApp",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"baileys",
|
|
7
7
|
"baileys-mod",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"automation",
|
|
15
15
|
"multi-device"
|
|
16
16
|
],
|
|
17
|
-
"homepage": "https://whatsapp.com/channel/
|
|
17
|
+
"homepage": "https://whatsapp.com/channel/",
|
|
18
18
|
"license": "MIT",
|
|
19
|
-
"author": "
|
|
19
|
+
"author": "ubed",
|
|
20
20
|
"main": "./lib/index.js",
|
|
21
21
|
"files": [
|
|
22
22
|
"lib/*",
|