@ubedsockets/baileys 1.2.0 → 1.3.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.
@@ -1,10 +1,5 @@
1
1
  const axios = require('axios');
2
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
3
  async function tiktok(url) {
9
4
  if (!url) throw new Error("URL tidak boleh kosong.");
10
5
 
@@ -19,36 +14,30 @@ async function tiktok(url) {
19
14
 
20
15
  const res = data.result;
21
16
 
22
- // Memetakan ulang agar response lebih bersih tapi tetap lengkap
23
17
  return {
24
18
  status: true,
19
+ // Mengecek apakah data mengandung foto atau video
25
20
  type: res.data.some(v => v.type === "photo") ? 'slideshow' : 'video',
26
21
  title: res.title || '-',
27
22
  metadata: {
28
- region: res.region,
29
23
  taken_at: res.taken_at,
24
+ region: res.region,
30
25
  author: {
31
26
  username: res.author.nickname,
32
27
  fullname: res.author.fullname,
33
28
  avatar: res.author.avatar
34
29
  },
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
- },
30
+ stats: res.stats,
42
31
  music: {
43
32
  title: res.music_info.title,
44
33
  author: res.music_info.author,
45
- url: res.music_info.url
34
+ url: res.music_info.url // Link MP3 ada di sini
46
35
  }
47
36
  },
48
- // Filter link download
49
37
  download: {
50
- video: res.data.find(v => v.type === "nowatermark")?.url || null,
51
- watermark: res.data.find(v => v.type === "watermark")?.url || null,
38
+ // Mencoba mencari HD dulu, kalau tidak ada pakai nowatermark biasa
39
+ video: res.data.find(v => v.type === "nowatermark_hd")?.url || res.data.find(v => v.type === "nowatermark")?.url || null,
40
+ music: res.music_info.url,
52
41
  photos: res.data.filter(v => v.type === "photo").map(v => v.url) || []
53
42
  }
54
43
  };
@@ -60,5 +49,4 @@ async function tiktok(url) {
60
49
  }
61
50
  }
62
51
 
63
- // Export fungsi agar bisa di-require langsung
64
52
  module.exports = tiktok;
package/lib/index.js CHANGED
@@ -16,8 +16,8 @@ const thanksColor = [
16
16
 
17
17
 
18
18
  const textColor = [
19
- "#FF1E1E",
20
- "#FF6A00",
19
+ "#f70190",
20
+ "#5900ff",
21
21
  "#FFD60A"
22
22
  ];
23
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubedsockets/baileys",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "@ubedsockets/baileys,baileys A high-performance WhatsApp Web API wrapper based on Baileys, optimized for bot developers with integrated utility scrapers.",
5
5
  "keywords": [
6
6
  "baileys",
@@ -19,7 +19,7 @@
19
19
  "automation",
20
20
  "multi-device"
21
21
  ],
22
- "homepage": "https://whatsapp.com/channel/",
22
+ "homepage": "https://wa.me/6285147777105",
23
23
  "license": "MIT",
24
24
  "author": "ubed",
25
25
  "main": "./lib/index.js",