@soyaxell09/zenbot-scraper 1.0.8 → 1.0.10

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
@@ -259,6 +259,45 @@ const pinVid = await pinvid('https://www.pinterest.com/pin/123/')
259
259
 
260
260
  ---
261
261
 
262
+ ### Imágenes de Anime (Wallhaven + Konachan)
263
+
264
+ ```js
265
+ import { animeImage } from '@soyaxell09/zenbot-scraper'
266
+
267
+ const results = await animeImage('naruto', 5)
268
+ // → [{ image, url, source }]
269
+ ```
270
+
271
+ > Devuelve imágenes SFW de Wallhaven y Konachan mezcladas aleatoriamente.
272
+
273
+ ### Wallpapers (BestHDWallpaper)
274
+
275
+ ```js
276
+ import { wallpaperSearch } from '@soyaxell09/zenbot-scraper'
277
+
278
+ const results = await wallpaperSearch('nature', 10)
279
+ // → [{ title, image, url }]
280
+ ```
281
+
282
+
283
+
284
+ ### Stickers (GetStickerPack)
285
+
286
+ ```js
287
+ import { stickerSearch } from '@soyaxell09/zenbot-scraper'
288
+
289
+ // Buscar packs por texto — devuelve un pack aleatorio con sus stickers
290
+ const result = await stickerSearch('anime', 10)
291
+ // → {
292
+ // status: true,
293
+ // nombre: 'My Hero Academia',
294
+ // creador: '@false_eye',
295
+ // total: 39,
296
+ // fotos: ['https://s3.getstickerpack.com/...webp', ...],
297
+ // url: 'https://getstickerpack.com/stickers/...'
298
+ // }
299
+ ```
300
+
262
301
  ## 🛠️ Tools
263
302
 
264
303
  ### YouTube v2 (via ytdown.to — más calidades)
@@ -377,23 +416,6 @@ const cats = newsCategories()
377
416
  ---
378
417
 
379
418
 
380
- ### Stickers (GetStickerPack)
381
-
382
- ```js
383
- import { stickerSearch } from '@soyaxell09/zenbot-scraper'
384
-
385
- // Buscar packs por texto — devuelve un pack aleatorio con sus stickers
386
- const result = await stickerSearch('anime', 10)
387
- // → {
388
- // status: true,
389
- // nombre: 'My Hero Academia',
390
- // creador: '@false_eye',
391
- // total: 39,
392
- // fotos: ['https://s3.getstickerpack.com/...webp', ...],
393
- // url: 'https://getstickerpack.com/stickers/...'
394
- // }
395
- ```
396
-
397
419
  ### Upload (Catbox.moe)
398
420
 
399
421
  ```js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soyaxell09/zenbot-scraper",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Scrapers de descarga y búsqueda para bots de WhatsApp — YouTube, TikTok, Facebook, Twitter, Pinterest, MediaFire, GitHub, APK, Google Drive y más.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/index.js CHANGED
@@ -19,6 +19,8 @@ export { spotify } from './searc
19
19
  export { giphy } from './search/giphy.js'
20
20
  export { pinsearch, pinimg, pinvid } from './search/pinterest.js'
21
21
  export { stickerSearch } from './search/stickersearch.js'
22
+ export { animeImage } from './search/anime.js'
23
+ export { wallpaperSearch } from './search/wallpaper.js'
22
24
  export { tiktokStalk } from './tools/tiktokstalk.js'
23
25
  export { lyricsSearch, lyricsGet } from './tools/lyrics.js'
24
26
  export { translate, getLangs } from './tools/translator.js'
@@ -2,8 +2,8 @@ export { ytInfo, ytDownload, ytSearch } from './youtu
2
2
  export { ytInfoV2, ytDownloadV2, getFileSizeV2 } from './youtubev2.js'
3
3
  export { tiktokInfo, tiktokDownload } from './tiktok.js'
4
4
  export { fbDownload } from './facebook.js'
5
- export { tweetInfo, tweetDownload } from './twitter.js'
5
+ export { tweetInfo, tweetDownload } from './twitter.js'
6
6
  export { mediafireInfo } from './mediafire.js'
7
7
  export { githubInfo, githubRelease, githubContents, githubSearch } from './github.js'
8
8
  export { apkSearch, apkInfo } from './apk.js'
9
- export { gdriveInfo, gdriveDownload } from './gdrive.js'
9
+ export { gdriveInfo, gdriveDownload } from './gdrive.js'
@@ -0,0 +1,73 @@
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
+ async function fromWallhaven(query, limit) {
16
+ const res = await axios.get(
17
+ `https://wallhaven.cc/search?q=${encodeURIComponent(query)}&categories=010&purity=100&sorting=relevance`,
18
+ { headers: HEADERS, timeout: 15000 }
19
+ )
20
+ const $ = cheerio.load(res.data)
21
+ const results = []
22
+
23
+ $('figure.thumb').each((_, el) => {
24
+ if (results.length >= limit) return false
25
+ const thumb = $(el).find('img.lazyload').attr('data-src') || $(el).find('img').attr('src') || ''
26
+ const id = $(el).attr('data-wallpaper-id') || ''
27
+ const url = id ? `https://wallhaven.cc/w/${id}` : ''
28
+ if (thumb) results.push({ image: thumb, url, source: 'wallhaven' })
29
+ })
30
+
31
+ return results
32
+ }
33
+
34
+ async function fromKonachan(query, limit) {
35
+ const res = await axios.get(
36
+ `https://konachan.com/post?tags=${encodeURIComponent(query + ' rating:s')}&limit=${limit}`,
37
+ { headers: HEADERS, timeout: 15000 }
38
+ )
39
+ const $ = cheerio.load(res.data)
40
+ const results = []
41
+
42
+ $('img.preview').each((_, el) => {
43
+ if (results.length >= limit) return false
44
+ const thumb = $(el).attr('src') || ''
45
+ const full = $(el).closest('a').attr('href') || ''
46
+ if (thumb) results.push({ image: thumb, url: full ? `https://konachan.com${full}` : '', source: 'konachan' })
47
+ })
48
+
49
+ return results
50
+ }
51
+
52
+ export async function animeImage(query, limit = 10) {
53
+ if (!query?.trim()) throw new Error('Query vacío')
54
+
55
+ const errors = []
56
+ let results = []
57
+
58
+ try {
59
+ const wh = await fromWallhaven(query, limit)
60
+ if (wh.length) results = results.concat(wh)
61
+ } catch (e) { errors.push('wallhaven: ' + e.message) }
62
+
63
+ try {
64
+ const kc = await fromKonachan(query, limit)
65
+ if (kc.length) results = results.concat(kc)
66
+ } catch (e) { errors.push('konachan: ' + e.message) }
67
+
68
+ if (!results.length) throw new Error('Sin resultados. Errores: ' + errors.join(' | '))
69
+
70
+ results = results.sort(() => Math.random() - 0.5).slice(0, limit)
71
+
72
+ return results
73
+ }
@@ -11,3 +11,5 @@ export { spotify } from './spotify.js'
11
11
  export { giphy } from './giphy.js'
12
12
  export { pinsearch, pinimg, pinvid } from './pinterest.js'
13
13
  export { stickerSearch } from './stickersearch.js'
14
+ export { animeImage } from './anime.js'
15
+ export { wallpaperSearch } from './wallpaper.js'
@@ -0,0 +1,45 @@
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
+ export async function wallpaperSearch(query, limit = 10) {
16
+ if (!query?.trim()) throw new Error('Query vacío')
17
+
18
+ const res = await axios.get(
19
+ 'https://www.besthdwallpaper.com/search?q=' + encodeURIComponent(query),
20
+ { headers: HEADERS, timeout: 15000 }
21
+ )
22
+
23
+ const $ = cheerio.load(res.data)
24
+ const results = []
25
+
26
+ $('img').each((_, el) => {
27
+ if (results.length >= limit) return false
28
+ const src = $(el).attr('src') || ''
29
+ if (!src.includes('bhdw.net') || src.includes('icon') || src.includes('svg')) return
30
+
31
+ const parent = $(el).closest('a')
32
+ const href = parent.attr('href') || ''
33
+ const alt = $(el).attr('alt') || ''
34
+ const title = alt.replace(/\s*download\s*$/i, '').trim()
35
+
36
+ results.push({
37
+ title,
38
+ image: src,
39
+ url: href ? 'https://www.besthdwallpaper.com' + href : '',
40
+ })
41
+ })
42
+
43
+ if (!results.length) throw new Error('Sin resultados para: ' + query)
44
+ return results
45
+ }