@soyaxell09/zenbot-scraper 1.1.6 → 1.1.8
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/package.json +1 -1
- package/src/index.js +2 -2
- package/src/scrapers/deezer.js +0 -2
- package/src/scrapers/index.js +1 -2
- package/src/scrapers/tiktok.js +44 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soyaxell09/zenbot-scraper",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "Scrapers de descarga y búsqueda para bots de WhatsApp — YouTube, TikTok, Instagram, Facebook, Twitter, Pinterest, MediaFire, GitHub, APK, Google Drive, XNXX, PornHub, XVideos, XHamster, Rule34, Screenshot y más.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
package/src/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
export { ytInfo, ytDownload, ytSearch, getFileSize } from './scrapers/youtube.js'
|
|
9
9
|
export { youtubeDownload } from './scrapers/youtubev2.js'
|
|
10
|
-
export { tiktokInfo, tiktokDownload } from './scrapers/tiktok.js'
|
|
10
|
+
export { tiktokInfo, tiktokDownload, tiktokSearch } from './scrapers/tiktok.js'
|
|
11
11
|
export { snaptikDownload } from './scrapers/snaptik.js'
|
|
12
12
|
export { deezerSearch, deezerTrack } from './scrapers/deezer.js'
|
|
13
13
|
export { igDownload, igReelDownload, igStalk, igStories } from './scrapers/instagram.js'
|
|
@@ -23,7 +23,7 @@ export { googleSearch } from './searc
|
|
|
23
23
|
export { giphy, gifNext, giphyBuffer } from './search/giphy.js'
|
|
24
24
|
export { pinsearch, pinimg, pinvid } from './search/pinterest.js'
|
|
25
25
|
export { stickerSearch } from './search/stickersearch.js'
|
|
26
|
-
export {
|
|
26
|
+
export { deezerFind, deezerSearchAlbum, deezerSearchArtist, deezerAlbumTracks, deezerArtistTopTracks } from './search/deezersearch.js'
|
|
27
27
|
export { animeImage } from './search/anime.js'
|
|
28
28
|
export { wallpaperSearch } from './search/wallpaper.js'
|
|
29
29
|
export { tiktokStalk } from './tools/tiktokstalk.js'
|
package/src/scrapers/deezer.js
CHANGED
package/src/scrapers/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { ytInfo, ytDownload, ytSearch, getFileSize } from './youtube.js'
|
|
2
2
|
export { youtubeDownload } from './youtubev2.js'
|
|
3
|
-
export { tiktokInfo, tiktokDownload } from './tiktok.js'
|
|
4
|
-
export { tiktokSearch } from './tiktok.js'
|
|
3
|
+
export { tiktokInfo, tiktokDownload, tiktokSearch } from './tiktok.js'
|
|
5
4
|
export { snaptikDownload } from './snaptik.js'
|
|
6
5
|
export { deezerSearch, deezerTrack } from './deezer.js'
|
|
7
6
|
export { fbDownload } from './facebook.js'
|
package/src/scrapers/tiktok.js
CHANGED
|
@@ -48,14 +48,53 @@ export async function tiktokDownload(url) {
|
|
|
48
48
|
url: d.music_info?.play || null,
|
|
49
49
|
cover: d.music_info?.cover || '',
|
|
50
50
|
},
|
|
51
|
-
plays:
|
|
52
|
-
likes:
|
|
53
|
-
comments:
|
|
54
|
-
shares:
|
|
55
|
-
source:
|
|
51
|
+
plays: d.play_count || 0,
|
|
52
|
+
likes: d.digg_count || 0,
|
|
53
|
+
comments: d.comment_count || 0,
|
|
54
|
+
shares: d.share_count || 0,
|
|
55
|
+
source: 'tikwm',
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export async function tiktokInfo(url) {
|
|
60
60
|
return tiktokDownload(url)
|
|
61
61
|
}
|
|
62
|
+
|
|
63
|
+
export async function tiktokSearch(query, limit = 5) {
|
|
64
|
+
if (!query?.trim()) throw new Error('Se requiere un término de búsqueda')
|
|
65
|
+
const count = Math.min(Math.max(1, limit), 20)
|
|
66
|
+
const res = await axios.get('https://tikwm.com/api/feed/search', {
|
|
67
|
+
params: { keywords: query, count, cursor: 0, HD: 1 },
|
|
68
|
+
headers: HEADERS,
|
|
69
|
+
timeout: 20000,
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
const data = res.data
|
|
73
|
+
if (data?.code !== 0 || !data?.data?.videos?.length)
|
|
74
|
+
throw new Error('tikwm search: ' + (data?.msg || 'sin resultados'))
|
|
75
|
+
|
|
76
|
+
return data.data.videos.map(d => ({
|
|
77
|
+
id: d.id || '',
|
|
78
|
+
title: d.title || '',
|
|
79
|
+
author: d.author?.nickname || d.author?.unique_id || '',
|
|
80
|
+
thumbnail: d.cover || d.origin_cover || '',
|
|
81
|
+
duration: d.duration || 0,
|
|
82
|
+
nowatermark: d.play || null,
|
|
83
|
+
watermark: d.wmplay || null,
|
|
84
|
+
audio: d.music || null,
|
|
85
|
+
images: Array.isArray(d.images) && d.images.length > 0
|
|
86
|
+
? d.images.map(img => typeof img === 'string' ? img : img?.url || img?.cover || '')
|
|
87
|
+
: null,
|
|
88
|
+
music: {
|
|
89
|
+
title: d.music_info?.title || '',
|
|
90
|
+
author: d.music_info?.author || '',
|
|
91
|
+
url: d.music_info?.play || null,
|
|
92
|
+
cover: d.music_info?.cover || '',
|
|
93
|
+
},
|
|
94
|
+
plays: d.play_count || 0,
|
|
95
|
+
likes: d.digg_count || 0,
|
|
96
|
+
comments: d.comment_count || 0,
|
|
97
|
+
shares: d.share_count || 0,
|
|
98
|
+
source: 'tikwm',
|
|
99
|
+
}))
|
|
100
|
+
}
|