@zenaveline/scraper 1.2.1 → 1.2.2

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/README.md CHANGED
@@ -88,6 +88,8 @@ Panggil nama fungsinya sesuai daftar di bawah ini untuk menikmati semua fiturnya
88
88
  | `twetterdownload(url)` | Unduh postingan video/gambar dari platform X (Twitter). |
89
89
  | `pinterestdownload(url)`| Ekstrak media gambar dan video dengan kualitas jernih dari Pinterest. |
90
90
  | `douyindl(url)` | Download video Douyin tanpa watermark. |
91
+ | `allinonedownloader(url, tool)` | Downloader all-in-one yang mendukung banyak platform (Tiktok, YouTube, IG, dll). |
92
+ | `tiktokdownload(url)` | Download video/foto Tiktok tanpa watermark. |
91
93
 
92
94
  ### 🎵 Musik & Audio
93
95
  | Fungsi | Deskripsi Singkat |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenaveline/scraper",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Kumpulan scraper yang mudah digunakan!",
5
5
  "keywords": [
6
6
  "@zenaveline/scraper",
@@ -0,0 +1,66 @@
1
+ /*
2
+ Base : https://wowdownloader.com
3
+ Author : Neo
4
+ WhatsApp Channel: https://whatsapp.com/channel/0029Vb6hVYK8V0tkiz4bKs0N
5
+ Support:
6
+ Tiktok
7
+ Twitter
8
+ Facebook
9
+ Instagram
10
+ Pinterest
11
+ LinkedIn
12
+ Douyin
13
+ Likee
14
+ SoundCloud
15
+ Spotify
16
+ Apple Music
17
+ YouTube
18
+ */
19
+ const axios = require('axios');
20
+
21
+ const tools = [
22
+ 'apple-music-downloader', 'douyin-downloader', 'facebook-video-downloader',
23
+ 'instagram-reels-downloader', 'instagram-story-downloader', 'instagram-video-downloader',
24
+ 'likee-downloader', 'linkedin-video-downloader', 'pinterest-video-downloader',
25
+ 'soundcloud-downloader', 'spotify-downloader', 'tiktok-photo-downloader',
26
+ 'tiktok-story-downloader', 'tiktok-video-downloader', 'twitter-gif-downloader',
27
+ 'twitter-video-downloader', 'youtube-monetization-checker', 'youtube-money-calculator',
28
+ 'youtube-tags-extractor', 'youtube-thumbnail-downloader', 'youtube-transcript',
29
+ 'youtube-video-downloader'
30
+ ];
31
+
32
+ async function wowdownloader(url, tool) {
33
+ try {
34
+ if (!url.includes('https://')) throw new Error('Invalid url.');
35
+ if (!tools.includes(tool)) throw new Error('Invalid tool.');
36
+
37
+ const { data: html, headers } = await axios.get(`https://wowdownloader.com/tool/${tool}`, {
38
+ headers: {
39
+ 'user-agent': 'Neo/1.0'
40
+ }
41
+ });
42
+
43
+ const csrfToken = html.match(/<meta name="csrf-token" content="([^"]+)">/)?.[1];
44
+ if (!csrfToken) throw new Error('Failed to get token.');
45
+
46
+ const { data } = await axios.post('https://wowdownloader.com/api/download', {
47
+ url: url,
48
+ tool: tool
49
+ }, {
50
+ headers: {
51
+ origin: 'https://wowdownloader.com',
52
+ referer: `https://wowdownloader.com/tool/${tool}`,
53
+ 'x-csrf-token': csrfToken,
54
+ cookie: headers['set-cookie']?.map(c => c.split(';')[0]).join('; '),
55
+ 'content-type': 'application/json',
56
+ 'user-agent': 'Neo/1.0'
57
+ }
58
+ });
59
+
60
+ return data;
61
+ } catch (error) {
62
+ throw new Error(error.response?.data?.error || error.message);
63
+ }
64
+ }
65
+
66
+ module.exports = wowdownloader;
@@ -0,0 +1,56 @@
1
+ //credit: by Nazir
2
+
3
+ async function tt(url) {
4
+ const html = await fetch(url, {
5
+ headers: {
6
+ authority: "www.tiktok.com",
7
+ "sec-ch-ua-mobile": "?1",
8
+ "sec-ch-ua-platform": `"Android"`,
9
+ "user-agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Mobile Safari/537.36"
10
+ }
11
+ }).then(a => a.text());
12
+ const match = html.match(/<script id="__UNIVERSAL_DATA_FOR_REHYDRATION__"[^>]*>([\s\S]*?)<\/script>/);
13
+ if (!match) return null;
14
+ const json = JSON.parse(match[1]);
15
+ const data = json.__DEFAULT_SCOPE__["webapp.reflow.video.detail"].itemInfo.itemStruct;
16
+ let download = data.imagePost
17
+ ? data.imagePost.images.reduce((acc, img) => {
18
+ return acc.concat(img.imageURL.urlList);
19
+ }, [])
20
+ : await fetch(`https://www.tiktok.com/player/api/v1/items?item_ids=${data.id}`)
21
+ .then(a => a.json())
22
+ .then(b => b.items[0].video_info.url_list[0]);
23
+ return {
24
+ id: data.id || data.aweme_id || null,
25
+ like: data.stats.diggCount || 0,
26
+ views: data.stats.playCount || data.play || 0,
27
+ share: data.stats.shareCount || 0,
28
+ comment: data.stats.commentCount || 0,
29
+ isVideo: data.imagePost ? false : true,
30
+ title: data.desc || data.suggestedWords?.[0] || "",
31
+ region: data.locationCreated || null,
32
+ duration: `${data.duration || data.music?.duration || 0} second`,
33
+ download: download,
34
+ author: {
35
+ id: data.author.id || "",
36
+ avatar: data.author?.avatarThumb,
37
+ nickname: data.author?.nickname || "",
38
+ username: data.author.uniqueId || "",
39
+ followers: data.author.followerCount || 0,
40
+ following: data.author.followingCount || 0,
41
+ like: data.author.heartCount || 0,
42
+ verified: data.author.verified,
43
+ videoCount: data.author.videoCount || 0
44
+ },
45
+ music: {
46
+ id: data.music?.id || null,
47
+ title: data.music?.title || "",
48
+ author: data.music?.authorName || "",
49
+ thumbnail: data.music?.coverLarge || data.music?.coverMedium || data.music?.coverThumb || null,
50
+ duration: data.music?.duration + " second" || "",
51
+ url: data.music?.playUrl || null
52
+ }
53
+ };
54
+ }
55
+
56
+ module.exports = tt;