@soyaxell09/zenbot-scraper 1.0.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/README.md ADDED
@@ -0,0 +1,344 @@
1
+ # @axeldev09/zenbot-scraper
2
+
3
+ Módulo npm de scrapers y herramientas para bots de WhatsApp. Incluye descargadores, buscadores y utilidades.
4
+
5
+ ## Instalación
6
+
7
+ ```bash
8
+ npm install @axeldev09/zenbot-scraper
9
+ ```
10
+
11
+ ---
12
+
13
+ ## 📁 Estructura
14
+
15
+ ```
16
+ src/
17
+ ├── scrapers/ → Descargadores de media
18
+ ├── search/ → Buscadores
19
+ └── tools/ → Utilidades
20
+ ```
21
+
22
+ ---
23
+
24
+ ## 🎬 Scrapers
25
+
26
+ ### YouTube
27
+
28
+ ```js
29
+ import { ytSearch, ytDownload, ytInfo } from '@axeldev09/zenbot-scraper'
30
+
31
+ // Buscar videos
32
+ const results = await ytSearch('bad bunny', 5)
33
+ // → [{ id, title, url, thumbnail, duration, views, channel, published }]
34
+
35
+ // Descargar (URL o texto)
36
+ const video = await ytDownload('https://youtu.be/dQw4w9WgXcQ', 'video', '360p')
37
+ const audio = await ytDownload('nicki nicole wapo traketero', 'mp3')
38
+ // → { title, author, thumbnail, type, url, duration, ... }
39
+ ```
40
+
41
+ ### YouTube v2 (via ytdown.to — más calidades)
42
+
43
+ ```js
44
+ import { ytDownloadV2, ytInfoV2, getFileSizeV2 } from '@axeldev09/zenbot-scraper'
45
+
46
+ // Ver calidades disponibles
47
+ const info = await ytInfoV2('https://youtu.be/dQw4w9WgXcQ')
48
+ // → { title, uploader, views, thumb, qualities: [{ id, type, quality, size, sizeB, duration }] }
49
+
50
+ // Descargar con calidad específica
51
+ const video = await ytDownloadV2('https://youtu.be/dQw4w9WgXcQ', 'video', '1080p')
52
+ const audio = await ytDownloadV2('https://youtu.be/dQw4w9WgXcQ', 'mp3', '128k')
53
+ // → { title, uploader, views, thumb, type, quality, size, sizeB, duration, url }
54
+
55
+ // Obtener tamaño de un archivo por URL
56
+ const size = await getFileSizeV2('https://example.com/file.mp4')
57
+ // → '14.5 MB'
58
+ ```
59
+
60
+ ### TikTok
61
+
62
+ ```js
63
+ import { tiktokDownload, tiktokInfo } from '@axeldev09/zenbot-scraper'
64
+
65
+ const result = await tiktokDownload('https://www.tiktok.com/@user/video/123')
66
+ // → { nowatermark, watermark, audio, music: { title, author, url }, stats: { plays, likes, comments, shares } }
67
+ ```
68
+
69
+ ### Facebook
70
+
71
+ ```js
72
+ import { fbDownload } from '@axeldev09/zenbot-scraper'
73
+
74
+ const result = await fbDownload('https://www.facebook.com/watch?v=123')
75
+ // → { hd, sd, thumb, title }
76
+ ```
77
+
78
+ ### Twitter / X
79
+
80
+ ```js
81
+ import { tweetInfo, tweetDownload } from '@axeldev09/zenbot-scraper'
82
+
83
+ // Info completa del tweet
84
+ const info = await tweetInfo('https://x.com/user/status/123')
85
+ // → { id, text, lang, createdAt, likes, replies, author: { name, username, avatar }, hashtags, mentions, medias }
86
+
87
+ // Solo media descargable
88
+ const media = await tweetDownload('https://x.com/user/status/123')
89
+ // → { id, text, author, videos: [{ type, url, thumbnail, variants }], photos: [{ type, url, width, height }] }
90
+ ```
91
+
92
+ ### MediaFire
93
+
94
+ ```js
95
+ import { mediafireInfo } from '@axeldev09/zenbot-scraper'
96
+
97
+ const result = await mediafireInfo('https://www.mediafire.com/file/abc123/archivo.apk/file')
98
+ // → { key, name, size, download, url }
99
+ ```
100
+
101
+ ### GitHub
102
+
103
+ ```js
104
+ import { githubInfo, githubRelease, githubContents, githubSearch } from '@axeldev09/zenbot-scraper'
105
+
106
+ // Info del repositorio
107
+ const info = await githubInfo('facebook/react')
108
+ // → { name, fullName, description, url, stars, forks, language, license, topics, owner, cloneUrl, zipUrl, ... }
109
+
110
+ // Último release
111
+ const release = await githubRelease('facebook/react')
112
+ // → { tag, name, body, publishedAt, url, assets: [{ name, size, downloadUrl, downloads }] }
113
+
114
+ // Contenido de un directorio o archivo
115
+ const contents = await githubContents('facebook/react', 'src')
116
+ // → [{ name, path, type, size, url, download }]
117
+
118
+ // Buscar repositorios o usuarios
119
+ const repos = await githubSearch('whatsapp bot', 'repositories', 5)
120
+ // → [{ name, description, url, stars, forks, language, updatedAt }]
121
+ ```
122
+
123
+ ### APK (APKPure)
124
+
125
+ ```js
126
+ import { apkSearch, apkInfo } from '@axeldev09/zenbot-scraper'
127
+
128
+ // Buscar por nombre
129
+ const results = await apkSearch('whatsapp', 3)
130
+ // → [{ name, developer, pkg, date, icon, appUrl, dlUrl }]
131
+
132
+ // Info por package name
133
+ const info = await apkInfo('com.whatsapp')
134
+ // → { name, developer, pkg, date, icon, download, dlLinks, url }
135
+ ```
136
+
137
+ ---
138
+
139
+ ## 🔍 Search
140
+
141
+ ### Google (DuckDuckGo)
142
+
143
+ ```js
144
+ import { googleSearch } from '@axeldev09/zenbot-scraper'
145
+
146
+ const results = await googleSearch('node.js tutorial', 5)
147
+ // → [{ title, url, snippet }]
148
+ ```
149
+
150
+ ### Spotify / Deezer
151
+
152
+ ```js
153
+ import { spotify } from '@axeldev09/zenbot-scraper'
154
+
155
+ // Buscar tracks
156
+ const tracks = await spotify('bad bunny', 'tracks', 5)
157
+ // → [{ title, artist, album, duration, thumbnail, url, preview }]
158
+
159
+ // Buscar álbumes
160
+ const albums = await spotify('bad bunny', 'albums', 3)
161
+ ```
162
+
163
+ ### Tenor (GIFs)
164
+
165
+ ```js
166
+ import { giphy } from '@axeldev09/zenbot-scraper'
167
+
168
+ const gifs = await giphy('funny cat', 5)
169
+ // → [{ id, title, url, gif, preview, mp4, width, height }]
170
+ ```
171
+
172
+ ### Pinterest
173
+
174
+ ```js
175
+ import { pinsearch, pinimg, pinvid } from '@axeldev09/zenbot-scraper'
176
+
177
+ // Buscar imágenes por texto
178
+ const imgs = await pinsearch('anime wallpaper', 5)
179
+ // → [{ index, image, url }]
180
+
181
+ // Imagen de un pin específico o por texto
182
+ const pin = await pinimg('https://www.pinterest.com/pin/123/')
183
+ const byText = await pinimg('anime wallpaper', 5)
184
+ // → { id, title, description, image, images, url } | [{ index, image, url }]
185
+
186
+ // Buscar videos por texto o URL de pin
187
+ const vids = await pinvid('anime', 5)
188
+ const pinVid = await pinvid('https://www.pinterest.com/pin/123/')
189
+ // → [{ index, video, sd, original }]
190
+ ```
191
+
192
+ ---
193
+
194
+ ## 🛠️ Tools
195
+
196
+ ### TikTok Stalk
197
+
198
+ ```js
199
+ import { tiktokStalk } from '@axeldev09/zenbot-scraper'
200
+
201
+ const profile = await tiktokStalk('charlidamelio')
202
+ // → { id, username, nickname, bio, avatar, verified, private, bioLink, stats: { followers, following, likes, videos, followersStr, ... }, url }
203
+ ```
204
+
205
+ ### Letras de canciones
206
+
207
+ ```js
208
+ import { lyricsSearch, lyricsGet } from '@axeldev09/zenbot-scraper'
209
+
210
+ // Buscar por texto libre
211
+ const results = await lyricsSearch('bad bunny tití me preguntó', 3)
212
+ // → [{ id, title, artist, album, duration, lyrics, lrc }]
213
+ // lrc = letra sincronizada con timestamps [00:00.00]
214
+
215
+ // Buscar por artista y título
216
+ const song = await lyricsGet('Bad Bunny', 'Tití Me Preguntó')
217
+ // → { id, title, artist, album, duration, lyrics, lrc }
218
+ ```
219
+
220
+ ### Traductor
221
+
222
+ ```js
223
+ import { translate, getLangs } from '@axeldev09/zenbot-scraper'
224
+
225
+ // Traducir (auto-detecta idioma origen)
226
+ const result = await translate('Hello, how are you?', 'es')
227
+ // → { original, translated, from, to, fromName, toName, source }
228
+
229
+ // Especificar idioma origen
230
+ const result2 = await translate('Hola cómo estás', 'en', 'es')
231
+
232
+ // Ver idiomas disponibles
233
+ const langs = getLangs()
234
+ // → [{ code: 'es', name: 'Español' }, { code: 'en', name: 'English' }, ...]
235
+
236
+ // Códigos disponibles: es, en, pt, fr, de, it, ja, ko, zh, ru, ar, hi, tr, nl, pl, sv, uk, vi, id
237
+ ```
238
+
239
+ ### Clima
240
+
241
+ ```js
242
+ import { weather } from '@axeldev09/zenbot-scraper'
243
+
244
+ const w = await weather('Buenos Aires')
245
+ // → { location, temp, feelsLike, humidity, wind, windDir, visibility, pressure, uvIndex, description, forecast: [{ date, maxTemp, minTemp, desc, sunrise, sunset }] }
246
+ ```
247
+
248
+ ### QR
249
+
250
+ ```js
251
+ import { qrGenerate, qrRead } from '@axeldev09/zenbot-scraper'
252
+
253
+ // Generar QR
254
+ const qr = await qrGenerate('https://github.com/axeldev09', 300)
255
+ // → { url, buffer, size, text }
256
+
257
+ // Leer QR desde URL de imagen
258
+ const result = await qrRead('https://example.com/qr.png')
259
+ // → { text, type }
260
+ ```
261
+
262
+ ### Acortador de URLs
263
+
264
+ ```js
265
+ import { shortenUrl, expandUrl } from '@axeldev09/zenbot-scraper'
266
+
267
+ // Acortar
268
+ const short = await shortenUrl('https://github.com/axeldev09/zenbot-scraper')
269
+ // → { short: 'https://is.gd/xxxxx', source: 'is.gd' }
270
+
271
+ // Expandir
272
+ const expanded = await expandUrl('https://is.gd/xxxxx')
273
+ // → { original, expanded }
274
+ ```
275
+
276
+ ### Noticias
277
+
278
+ ```js
279
+ import { news, newsCategories } from '@axeldev09/zenbot-scraper'
280
+
281
+ // Obtener noticias
282
+ const n = await news('es', 5)
283
+ // → { category, source, items: [{ title, description, url, image, published, source }] }
284
+
285
+ // Categorías disponibles
286
+ const cats = newsCategories()
287
+ // → ['es', 'en', 'pt', 'tech', 'sports', 'science', 'world']
288
+ ```
289
+
290
+ ---
291
+
292
+
293
+ ### Upload (Catbox.moe)
294
+
295
+ ```js
296
+ import { upload } from '@axeldev09/zenbot-scraper'
297
+
298
+ // Por ruta de archivo local
299
+ const r1 = await upload('/sdcard/foto.jpg')
300
+ // → { url: 'https://files.catbox.moe/xxxxx.jpg', filename: 'foto.jpg' }
301
+
302
+ // Por URL remota
303
+ const r2 = await upload('https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg')
304
+ // → { url: 'https://files.catbox.moe/xxxxx.jpg', filename: 'file.jpg' }
305
+
306
+ // Por Buffer
307
+ const r3 = await upload(buffer, 'video.mp4')
308
+ // → { url: 'https://files.catbox.moe/xxxxx.mp4', filename: 'video.mp4' }
309
+ ```
310
+
311
+ > Sube archivos a Catbox.moe y devuelve una URL pública. Soporta imágenes, videos, audio y cualquier archivo hasta 200MB.
312
+
313
+ ## 📦 Importación por módulo
314
+
315
+ ```js
316
+ // Todo desde el índice principal
317
+ import { ytDownload, tiktokDownload, translate, weather } from '@axeldev09/zenbot-scraper'
318
+
319
+ // Solo scrapers
320
+ import { ytDownload, fbDownload } from '@axeldev09/zenbot-scraper/scrapers'
321
+
322
+ // Solo search
323
+ import { googleSearch, spotify } from '@axeldev09/zenbot-scraper/search'
324
+
325
+ // Solo tools
326
+ import { translate, weather, news } from '@axeldev09/zenbot-scraper/tools'
327
+ ```
328
+
329
+ ---
330
+
331
+ ## ⚙️ Requisitos
332
+
333
+ - Node.js >= 18.0.0
334
+ - Dependencias: `axios`, `cheerio`, `@distube/ytdl-core`, `form-data`
335
+
336
+ ---
337
+
338
+ ## 👤 Autor
339
+
340
+ **AxelDev09** — [GitHub](https://github.com/axeldev09)
341
+
342
+ ## 📄 Licencia
343
+
344
+ MIT
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@soyaxell09/zenbot-scraper",
3
+ "version": "1.0.0",
4
+ "description": "Scrapers de descarga y búsqueda para bots de WhatsApp — YouTube, TikTok, Facebook, Twitter, Pinterest, MediaFire, GitHub, APK y más.",
5
+ "type": "module",
6
+ "main": "src/index.js",
7
+ "exports": {
8
+ ".": "./src/index.js",
9
+ "./scrapers": "./src/scrapers/index.js",
10
+ "./search": "./src/search/index.js",
11
+ "./tools": "./src/tools/index.js"
12
+ },
13
+ "scripts": {
14
+ "test": "node test/index.js"
15
+ },
16
+ "keywords": [
17
+ "whatsapp",
18
+ "bot",
19
+ "scraper",
20
+ "downloader",
21
+ "youtube",
22
+ "tiktok",
23
+ "facebook",
24
+ "twitter",
25
+ "pinterest",
26
+ "mediafire",
27
+ "github",
28
+ "apk",
29
+ "deezer",
30
+ "tenor",
31
+ "google",
32
+ "weather",
33
+ "lyrics",
34
+ "translate",
35
+ "qr",
36
+ "news",
37
+ "upload"
38
+ ],
39
+ "author": "AxelDev09",
40
+ "license": "MIT",
41
+ "dependencies": {
42
+ "@distube/ytdl-core": "^4.16.0",
43
+ "axios": "^1.6.0",
44
+ "cheerio": "^1.0.0",
45
+ "form-data": "^4.0.0"
46
+ },
47
+ "engines": {
48
+ "node": ">=18.0.0"
49
+ },
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "https://github.com/axeldev09/zenbot-scraper"
53
+ }
54
+ }
package/src/index.js ADDED
@@ -0,0 +1,27 @@
1
+ /*
2
+ * © Created by AxelDev09 🔥
3
+ * GitHub: https://github.com/AxelDev09
4
+ * Instagram: @axeldev09
5
+ * Deja los créditos we 🗣️
6
+ */
7
+
8
+ export { ytInfo, ytDownload, ytSearch } from './scrapers/youtube.js'
9
+ export { ytInfoV2, ytDownloadV2, getFileSizeV2 } from './scrapers/youtubev2.js'
10
+ export { tiktokInfo, tiktokDownload } from './scrapers/tiktok.js'
11
+ export { fbDownload } from './scrapers/facebook.js'
12
+ export { tweetInfo, tweetDownload } from './scrapers/twitter.js'
13
+ export { mediafireInfo } from './scrapers/mediafire.js'
14
+ export { githubInfo, githubRelease, githubContents, githubSearch } from './scrapers/github.js'
15
+ export { apkSearch, apkInfo } from './scrapers/apk.js'
16
+ export { googleSearch } from './search/google.js'
17
+ export { spotify } from './search/spotify.js'
18
+ export { giphy } from './search/giphy.js'
19
+ export { pinsearch, pinimg, pinvid } from './search/pinterest.js'
20
+ export { tiktokStalk } from './tools/tiktokstalk.js'
21
+ export { lyricsSearch, lyricsGet } from './tools/lyrics.js'
22
+ export { translate, getLangs } from './tools/translator.js'
23
+ export { weather } from './tools/weather.js'
24
+ export { qrGenerate, qrRead } from './tools/qr.js'
25
+ export { shortenUrl, expandUrl } from './tools/urlshortener.js'
26
+ export { news, newsCategories } from './tools/news.js'
27
+ export { upload } from './tools/upload.js'
@@ -0,0 +1,112 @@
1
+ /*
2
+ * © Created by AxelDev09 🔥
3
+ * GitHub: https://github.com/AxelDev09
4
+ * Instagram: @axeldev09
5
+ * Deja los créditos we 🗣️
6
+ */
7
+
8
+ import axios from 'axios'
9
+ import * as cheerio from 'cheerio'
10
+
11
+ const HEADERS = {
12
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/120.0.0.0 Safari/537.36',
13
+ }
14
+
15
+ function extractPkg(href) {
16
+ const m = href?.match(/\/((?:com|org|net|io|co)\.[a-z0-9.]+)(?:\/|$)/i)
17
+ return m ? m[1] : ''
18
+ }
19
+
20
+ async function searchPage(query) {
21
+ const res = await axios.get(
22
+ `https://apkpure.com/search?q=${encodeURIComponent(query)}`,
23
+ { headers: HEADERS, timeout: 15000 }
24
+ )
25
+ return cheerio.load(res.data)
26
+ }
27
+
28
+ export async function apkSearch(query, limit = 5) {
29
+ if (!query?.trim()) throw new Error('Query vacío')
30
+
31
+ const $ = await searchPage(query)
32
+ const results = []
33
+ const seen = new Set()
34
+
35
+ $('.brand-info-top').each((_, el) => {
36
+ if (results.length >= limit) return false
37
+
38
+ const name = $(el).find('.p1').text().trim()
39
+ const dev = $(el).find('.p2').text().trim()
40
+ const date = $(el).find('.date').text().trim()
41
+ const icon = $(el).closest('.search-result').find('img').first().attr('src') || ''
42
+
43
+ const appHref = $(el).closest('.search-result')
44
+ .find('a[href]').toArray()
45
+ .map(a => $(a).attr('href'))
46
+ .find(h => extractPkg(h)) || ''
47
+
48
+ const pkg = extractPkg(appHref)
49
+ if (!name || !pkg || seen.has(pkg)) return
50
+ seen.add(pkg)
51
+
52
+ const appUrl = appHref.startsWith('http') ? appHref : `https://apkpure.com${appHref}`
53
+
54
+ results.push({
55
+ name,
56
+ developer: dev,
57
+ pkg,
58
+ date,
59
+ icon,
60
+ appUrl,
61
+ dlUrl: `https://d.apkpure.com/b/XAPK/${pkg}?version=latest`,
62
+ })
63
+ })
64
+
65
+ if (!results.length) throw new Error('No se encontraron resultados')
66
+ return results
67
+ }
68
+
69
+ export async function apkInfo(pkgOrUrl) {
70
+ let pkg = pkgOrUrl
71
+ if (pkgOrUrl.includes('apkpure.com')) {
72
+ pkg = extractPkg(pkgOrUrl) || pkgOrUrl
73
+ }
74
+
75
+ // Buscar por última parte del pkg (ej: "whatsapp" de "com.whatsapp")
76
+ const shortName = pkg.split('.').pop()
77
+ const $ = await searchPage(shortName)
78
+
79
+ // Buscar el item que tenga el pkg correcto
80
+ let found = null
81
+ $('.brand-info-top').each((_, el) => {
82
+ if (found) return false
83
+ const appHref = $(el).closest('.search-result')
84
+ .find('a[href]').toArray()
85
+ .map(a => $(a).attr('href'))
86
+ .find(h => h?.includes(pkg))
87
+ if (appHref) found = el
88
+ })
89
+
90
+ const el = found ? $(found) : $('.brand-info-top').first()
91
+ const name = el.find('.p1').text().trim()
92
+ const dev = el.find('.p2').text().trim()
93
+ const date = el.find('.date').text().trim()
94
+ const icon = el.closest('.search-result').find('img').first().attr('src') || ''
95
+
96
+ const dlLinks = []
97
+ $(`a[href*="d.apkpure.com"]`).each((_, a) => {
98
+ const href = $(a).attr('href') || ''
99
+ if (href.includes(pkg)) dlLinks.push(href)
100
+ })
101
+
102
+ return {
103
+ name,
104
+ developer: dev,
105
+ pkg,
106
+ date,
107
+ icon,
108
+ download: `https://d.apkpure.com/b/XAPK/${pkg}?version=latest`,
109
+ dlLinks: [...new Set(dlLinks)],
110
+ url: `https://apkpure.com/search?q=${shortName}`,
111
+ }
112
+ }