@soyaxell09/zenbot-scraper 1.0.12 → 1.1.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 +74 -90
- package/package.json +2 -2
- package/src/index.js +6 -6
- package/src/nsfw/index.js +2 -3
- package/src/nsfw/rule34.js +0 -39
- package/src/scrapers/apk.js +67 -73
- package/src/scrapers/index.js +3 -3
- package/src/scrapers/threads.js +55 -0
- package/src/scrapers/youtube.js +160 -114
- package/src/search/giphy.js +67 -12
- package/src/search/index.js +8 -8
- package/src/search/pinterest.js +182 -46
- package/src/search/spotify.js +1 -1
- package/src/scrapers/instagram.js +0 -98
- package/src/scrapers/youtubev2.js +0 -131
package/README.md
CHANGED
|
@@ -27,29 +27,19 @@ src/
|
|
|
27
27
|
### YouTube
|
|
28
28
|
|
|
29
29
|
```js
|
|
30
|
-
import { ytSearch, ytDownload, ytInfo } from '@soyaxell09/zenbot-scraper'
|
|
30
|
+
import { ytSearch, ytDownload, ytInfo, getFileSize } from '@soyaxell09/zenbot-scraper'
|
|
31
31
|
|
|
32
32
|
const results = await ytSearch('bad bunny', 5)
|
|
33
33
|
// → [{ id, title, url, thumbnail, duration, views, channel, published }]
|
|
34
34
|
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
// → { title, author, thumbnail, type, url, duration, ... }
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### YouTube v2 (via ytdown.to — más calidades)
|
|
41
|
-
|
|
42
|
-
```js
|
|
43
|
-
import { ytDownloadV2, ytInfoV2, getFileSizeV2 } from '@soyaxell09/zenbot-scraper'
|
|
44
|
-
|
|
45
|
-
const info = await ytInfoV2('https://youtu.be/dQw4w9WgXcQ')
|
|
46
|
-
// → { title, uploader, views, thumb, qualities: [{ id, type, quality, size, sizeB, duration }] }
|
|
35
|
+
const info = await ytInfo('https://youtu.be/dQw4w9WgXcQ')
|
|
36
|
+
// → { id, title, uploader, views, thumb, duration, qualities: [{ id, type, quality, size, sizeB, duration }] }
|
|
47
37
|
|
|
48
|
-
const video = await
|
|
49
|
-
const audio = await
|
|
38
|
+
const video = await ytDownload('https://youtu.be/dQw4w9WgXcQ', 'video', '360p')
|
|
39
|
+
const audio = await ytDownload('https://youtu.be/dQw4w9WgXcQ', 'mp3', '128k')
|
|
50
40
|
// → { title, uploader, views, thumb, type, quality, size, sizeB, duration, url }
|
|
51
41
|
|
|
52
|
-
const size = await
|
|
42
|
+
const size = await getFileSize('https://example.com/file.mp4')
|
|
53
43
|
// → '14.5 MB'
|
|
54
44
|
```
|
|
55
45
|
|
|
@@ -59,29 +49,28 @@ const size = await getFileSizeV2('https://example.com/file.mp4')
|
|
|
59
49
|
import { tiktokDownload, tiktokInfo } from '@soyaxell09/zenbot-scraper'
|
|
60
50
|
|
|
61
51
|
const result = await tiktokDownload('https://www.tiktok.com/@user/video/123')
|
|
62
|
-
// → {
|
|
52
|
+
// → { id, title, author, thumbnail, duration, nowatermark, watermark, audio, images, music, plays, likes, comments, shares }
|
|
63
53
|
```
|
|
64
54
|
|
|
65
55
|
### Instagram
|
|
66
56
|
|
|
67
57
|
```js
|
|
68
|
-
import { igDownload } from '@soyaxell09/zenbot-scraper'
|
|
58
|
+
import { igDownload, igReelDownload, igStalk, igStories } from '@soyaxell09/zenbot-scraper'
|
|
69
59
|
|
|
70
|
-
const
|
|
71
|
-
// → { type, items: [{ type
|
|
72
|
-
// type: 'reel' | 'post' | 'story' | 'video' | 'profile'
|
|
73
|
-
// Soporta: Videos, Fotos, Reels, Stories y Perfil (públicos)
|
|
74
|
-
```
|
|
60
|
+
const post = await igDownload('https://www.instagram.com/p/ABC123/')
|
|
61
|
+
// → { type, items: [{ type, url }] }
|
|
75
62
|
|
|
76
|
-
|
|
63
|
+
const reel = await igReelDownload('https://www.instagram.com/reel/ABC123/')
|
|
64
|
+
// → { type, items: [{ type, url }] }
|
|
77
65
|
|
|
78
|
-
|
|
79
|
-
|
|
66
|
+
const story = await igDownload('https://www.instagram.com/stories/user/123456789/')
|
|
67
|
+
// → { type: 'story', items: [{ type, url }] }
|
|
80
68
|
|
|
81
|
-
const
|
|
82
|
-
// → {
|
|
83
|
-
|
|
84
|
-
|
|
69
|
+
const perfil = await igStalk('siamusic')
|
|
70
|
+
// → { username, fullName, bio, followers, following, posts, isPrivate, isVerified, avatar, url }
|
|
71
|
+
|
|
72
|
+
const stories = await igStories('siamusic')
|
|
73
|
+
// → { username, items: [{ type, url }] }
|
|
85
74
|
```
|
|
86
75
|
|
|
87
76
|
### Facebook
|
|
@@ -90,7 +79,7 @@ const result = await igDownload('https://www.instagram.com/reel/xxx/')
|
|
|
90
79
|
import { fbDownload } from '@soyaxell09/zenbot-scraper'
|
|
91
80
|
|
|
92
81
|
const result = await fbDownload('https://www.facebook.com/watch?v=123')
|
|
93
|
-
// → { hd, sd, thumb,
|
|
82
|
+
// → { videoId, title, hd, sd, thumb, source }
|
|
94
83
|
```
|
|
95
84
|
|
|
96
85
|
### Twitter / X
|
|
@@ -98,13 +87,31 @@ const result = await fbDownload('https://www.facebook.com/watch?v=123')
|
|
|
98
87
|
```js
|
|
99
88
|
import { tweetInfo, tweetDownload } from '@soyaxell09/zenbot-scraper'
|
|
100
89
|
|
|
101
|
-
const info
|
|
90
|
+
const info = await tweetInfo('https://x.com/user/status/123')
|
|
102
91
|
// → { id, text, lang, createdAt, likes, replies, author: { name, username, avatar }, hashtags, mentions, medias }
|
|
103
92
|
|
|
104
93
|
const media = await tweetDownload('https://x.com/user/status/123')
|
|
105
94
|
// → { id, text, author, videos: [{ type, url, thumbnail, variants }], photos: [{ type, url, width, height }] }
|
|
106
95
|
```
|
|
107
96
|
|
|
97
|
+
### Threads
|
|
98
|
+
|
|
99
|
+
```js
|
|
100
|
+
import { threadsDownload } from '@soyaxell09/zenbot-scraper'
|
|
101
|
+
|
|
102
|
+
const result = await threadsDownload('https://www.threads.net/t/xxx')
|
|
103
|
+
// → { title, medias: [{ type, url }] }
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Spotify (SpotiDown)
|
|
107
|
+
|
|
108
|
+
```js
|
|
109
|
+
import { spotidownTrack } from '@soyaxell09/zenbot-scraper'
|
|
110
|
+
|
|
111
|
+
const result = await spotidownTrack('https://open.spotify.com/track/xxx')
|
|
112
|
+
// → { name, artist, album, year, duration, cover, mp3, coverHd }
|
|
113
|
+
```
|
|
114
|
+
|
|
108
115
|
### MediaFire
|
|
109
116
|
|
|
110
117
|
```js
|
|
@@ -149,16 +156,6 @@ const file = await gdriveDownload('https://drive.google.com/file/d/1ABC.../view'
|
|
|
149
156
|
// → { fileId, buffer, contentType, size, url }
|
|
150
157
|
```
|
|
151
158
|
|
|
152
|
-
### Spotify (SpotiDown)
|
|
153
|
-
|
|
154
|
-
```js
|
|
155
|
-
import { spotidownTrack } from '@soyaxell09/zenbot-scraper'
|
|
156
|
-
|
|
157
|
-
const result = await spotidownTrack('https://open.spotify.com/track/xxx')
|
|
158
|
-
// → { name, artist, album, year, duration, cover, mp3, coverHd }
|
|
159
|
-
// mp3 y coverHd son URLs de descarga directa
|
|
160
|
-
```
|
|
161
|
-
|
|
162
159
|
---
|
|
163
160
|
|
|
164
161
|
## 🔍 Search
|
|
@@ -184,10 +181,17 @@ const tracks = await spotify('bad bunny', 'tracks', 5)
|
|
|
184
181
|
### Tenor (GIFs)
|
|
185
182
|
|
|
186
183
|
```js
|
|
187
|
-
import { giphy } from '@soyaxell09/zenbot-scraper'
|
|
184
|
+
import { giphy, gifNext, giphyBuffer } from '@soyaxell09/zenbot-scraper'
|
|
188
185
|
|
|
189
186
|
const gifs = await giphy('funny cat', 5)
|
|
190
187
|
// → [{ id, title, url, gif, preview, mp4, width, height }]
|
|
188
|
+
|
|
189
|
+
const next = await gifNext('funny cat')
|
|
190
|
+
// → { id, title, url, gif, preview, mp4, width, height }
|
|
191
|
+
// Mantiene una cola paginada — cada llamada devuelve el siguiente GIF sin repetir
|
|
192
|
+
|
|
193
|
+
const buf = await giphyBuffer('funny cat')
|
|
194
|
+
// → { buffer, mimetype, title, url }
|
|
191
195
|
```
|
|
192
196
|
|
|
193
197
|
### Pinterest
|
|
@@ -195,8 +199,13 @@ const gifs = await giphy('funny cat', 5)
|
|
|
195
199
|
```js
|
|
196
200
|
import { pinsearch, pinimg, pinvid } from '@soyaxell09/zenbot-scraper'
|
|
197
201
|
|
|
198
|
-
const imgs = await pinsearch('anime wallpaper',
|
|
202
|
+
const imgs = await pinsearch('anime wallpaper', 50)
|
|
203
|
+
// → [{ index, image, url, pinId }]
|
|
204
|
+
// Paginación infinita — carga más resultados automáticamente si limit > resultados en caché
|
|
205
|
+
|
|
199
206
|
const pin = await pinimg('https://www.pinterest.com/pin/123/')
|
|
207
|
+
// → { id, title, description, altText, image, images, width, height, dominantColor, saves, repins, createdAt, tags, domain, link, board, creator, pinner, url }
|
|
208
|
+
|
|
200
209
|
const vids = await pinvid('anime', 5)
|
|
201
210
|
```
|
|
202
211
|
|
|
@@ -277,7 +286,10 @@ const w = await weather('Buenos Aires')
|
|
|
277
286
|
import { qrGenerate, qrRead } from '@soyaxell09/zenbot-scraper'
|
|
278
287
|
|
|
279
288
|
const qr = await qrGenerate('https://github.com/axeldev09', 300)
|
|
289
|
+
// → { url, buffer, size, text }
|
|
290
|
+
|
|
280
291
|
const result = await qrRead('https://example.com/qr.png')
|
|
292
|
+
// → { text, type }
|
|
281
293
|
```
|
|
282
294
|
|
|
283
295
|
### Acortador de URLs
|
|
@@ -286,7 +298,10 @@ const result = await qrRead('https://example.com/qr.png')
|
|
|
286
298
|
import { shortenUrl, expandUrl } from '@soyaxell09/zenbot-scraper'
|
|
287
299
|
|
|
288
300
|
const short = await shortenUrl('https://github.com/axeldev09/zenbot-scraper')
|
|
301
|
+
// → { short, source }
|
|
302
|
+
|
|
289
303
|
const expanded = await expandUrl('https://is.gd/xxxxx')
|
|
304
|
+
// → { original, expanded }
|
|
290
305
|
```
|
|
291
306
|
|
|
292
307
|
### Noticias
|
|
@@ -295,6 +310,8 @@ const expanded = await expandUrl('https://is.gd/xxxxx')
|
|
|
295
310
|
import { news, newsCategories } from '@soyaxell09/zenbot-scraper'
|
|
296
311
|
|
|
297
312
|
const n = await news('es', 5)
|
|
313
|
+
// → { category, source, items: [{ title, description, url, image, published, source }] }
|
|
314
|
+
|
|
298
315
|
const cats = newsCategories()
|
|
299
316
|
// → ['es', 'en', 'pt', 'tech', 'sports', 'science', 'world']
|
|
300
317
|
```
|
|
@@ -325,98 +342,65 @@ const r3 = await upload(buffer, 'video.mp4')
|
|
|
325
342
|
|
|
326
343
|
> ⚠️ Solo para bots con verificación de edad. Usá responsablemente.
|
|
327
344
|
|
|
328
|
-
### XNXX
|
|
345
|
+
### XNXX
|
|
329
346
|
|
|
330
347
|
```js
|
|
331
|
-
import { xnxxSearch } from '@soyaxell09/zenbot-scraper'
|
|
348
|
+
import { xnxxSearch, xnxxDownload } from '@soyaxell09/zenbot-scraper'
|
|
332
349
|
|
|
333
350
|
const results = await xnxxSearch('query', 10)
|
|
334
351
|
// → [{ title, url, thumb, preview, duration, views, quality, uploader }]
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
### XNXX Download
|
|
338
|
-
|
|
339
|
-
```js
|
|
340
|
-
import { xnxxDownload } from '@soyaxell09/zenbot-scraper'
|
|
341
352
|
|
|
342
353
|
const result = await xnxxDownload('https://www.xnxx.com/video-xxx/...')
|
|
343
354
|
// → { title, thumb, uploader, duration, views, uploadDate, download: { low, high, hls } }
|
|
344
355
|
```
|
|
345
356
|
|
|
346
|
-
### PornHub
|
|
357
|
+
### PornHub
|
|
347
358
|
|
|
348
359
|
```js
|
|
349
|
-
import { phSearch } from '@soyaxell09/zenbot-scraper'
|
|
360
|
+
import { phSearch, phDownload, phDownloadBuffer } from '@soyaxell09/zenbot-scraper'
|
|
350
361
|
|
|
351
362
|
const results = await phSearch('query', 10)
|
|
352
363
|
// → [{ title, url, thumb, preview, duration, vkey }]
|
|
353
|
-
```
|
|
354
364
|
|
|
355
|
-
### PornHub Download
|
|
356
|
-
|
|
357
|
-
```js
|
|
358
|
-
import { phDownload, phDownloadBuffer } from '@soyaxell09/zenbot-scraper'
|
|
359
|
-
|
|
360
|
-
// Solo info + HLS streams
|
|
361
365
|
const result = await phDownload('https://www.pornhub.com/view_video.php?viewkey=xxx')
|
|
362
366
|
// → { title, thumb, duration, uploadDate, hls: { '1080p', '720p', '480p', '240p' } }
|
|
363
367
|
|
|
364
|
-
// Convertir a mp4 con ffmpeg (requiere ffmpeg instalado)
|
|
365
368
|
const video = await phDownloadBuffer('https://www.pornhub.com/view_video.php?viewkey=xxx', '720')
|
|
366
369
|
// → { title, thumb, duration, uploadDate, buffer, quality }
|
|
367
370
|
```
|
|
368
371
|
|
|
369
|
-
### XVideos
|
|
372
|
+
### XVideos
|
|
370
373
|
|
|
371
374
|
```js
|
|
372
|
-
import { xvideosSearch } from '@soyaxell09/zenbot-scraper'
|
|
375
|
+
import { xvideosSearch, xvideosDownload } from '@soyaxell09/zenbot-scraper'
|
|
373
376
|
|
|
374
377
|
const results = await xvideosSearch('query', 10)
|
|
375
378
|
// → [{ title, url, thumb, preview, duration, views, quality }]
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
### XVideos Download
|
|
379
|
-
|
|
380
|
-
```js
|
|
381
|
-
import { xvideosDownload } from '@soyaxell09/zenbot-scraper'
|
|
382
379
|
|
|
383
380
|
const result = await xvideosDownload('https://www.xvideos.com/video.xxx/...')
|
|
384
381
|
// → { title, thumb, duration, views, uploadDate, download: { low, high, hls } }
|
|
385
382
|
```
|
|
386
383
|
|
|
387
|
-
### XHamster
|
|
384
|
+
### XHamster
|
|
388
385
|
|
|
389
386
|
```js
|
|
390
|
-
import { xhamsterSearch } from '@soyaxell09/zenbot-scraper'
|
|
387
|
+
import { xhamsterSearch, xhamsterDownload, xhamsterDownloadBuffer } from '@soyaxell09/zenbot-scraper'
|
|
391
388
|
|
|
392
389
|
const results = await xhamsterSearch('query', 10)
|
|
393
390
|
// → [{ title, url, thumb, preview, duration, views }]
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
### XHamster Download
|
|
397
391
|
|
|
398
|
-
```js
|
|
399
|
-
import { xhamsterDownload, xhamsterDownloadBuffer } from '@soyaxell09/zenbot-scraper'
|
|
400
|
-
|
|
401
|
-
// Info + calidades HLS
|
|
402
392
|
const result = await xhamsterDownload('https://xhamster.com/videos/...')
|
|
403
393
|
// → { title, thumb, duration, views, download: { '144p', '240p', '480p', '720p', '1080p' } }
|
|
404
394
|
|
|
405
|
-
// Convertir a mp4 con ffmpeg (requiere ffmpeg instalado)
|
|
406
395
|
const video = await xhamsterDownloadBuffer('https://xhamster.com/videos/...', '480p')
|
|
407
396
|
// → { title, thumb, duration, views, buffer, quality }
|
|
408
397
|
```
|
|
409
398
|
|
|
410
|
-
### Rule34 (
|
|
399
|
+
### Rule34 (paheal)
|
|
411
400
|
|
|
412
401
|
```js
|
|
413
|
-
import {
|
|
414
|
-
|
|
415
|
-
// Buscar por tags (usa yande.re, cae a paheal si no hay resultados)
|
|
416
|
-
const results = await rule34Search('cat_girl', 10)
|
|
417
|
-
// → [{ id, url, full, preview, tags, score, width, height }]
|
|
402
|
+
import { rule34Random } from '@soyaxell09/zenbot-scraper'
|
|
418
403
|
|
|
419
|
-
// Imagen random (usa paheal, con o sin tags)
|
|
420
404
|
const random = await rule34Random('cat_girl')
|
|
421
405
|
const any = await rule34Random()
|
|
422
406
|
// → { id, url, full, preview, tags, score, width, height }
|
|
@@ -429,7 +413,7 @@ const any = await rule34Random()
|
|
|
429
413
|
```js
|
|
430
414
|
import { ytDownload, tiktokDownload, igDownload, translate, weather } from '@soyaxell09/zenbot-scraper'
|
|
431
415
|
import { ytDownload, fbDownload, igDownload } from '@soyaxell09/zenbot-scraper/scrapers'
|
|
432
|
-
import { googleSearch, spotify }
|
|
416
|
+
import { googleSearch, spotify, gifNext, pinsearch } from '@soyaxell09/zenbot-scraper/search'
|
|
433
417
|
import { translate, weather, news, screenshot } from '@soyaxell09/zenbot-scraper/tools'
|
|
434
418
|
import { xnxxSearch, phSearch, rule34Random, xhamsterSearch } from '@soyaxell09/zenbot-scraper/nsfw'
|
|
435
419
|
```
|
|
@@ -439,7 +423,7 @@ import { xnxxSearch, phSearch, rule34Random, xhamsterSearch } from '@soy
|
|
|
439
423
|
## ⚙️ Requisitos
|
|
440
424
|
|
|
441
425
|
- Node.js >= 18.0.0
|
|
442
|
-
- Dependencias: `axios`, `cheerio`,
|
|
426
|
+
- Dependencias: `axios`, `cheerio`, `yt-search`, `form-data`
|
|
443
427
|
- Para `phDownloadBuffer` y `xhamsterDownloadBuffer`: requiere `ffmpeg` instalado en el sistema
|
|
444
428
|
|
|
445
429
|
---
|
|
@@ -452,7 +436,7 @@ import { xnxxSearch, phSearch, rule34Random, xhamsterSearch } from '@soy
|
|
|
452
436
|
|
|
453
437
|
## ⭐ Apoyá el proyecto
|
|
454
438
|
|
|
455
|
-
Si este módulo te fue útil, dejá una ⭐ en el repositorio.
|
|
439
|
+
Si este módulo te fue útil, dejá una ⭐ en el repositorio.
|
|
456
440
|
|
|
457
441
|
**Dejá los créditos** si usás este módulo en tu bot — es lo único que se pide 🙏
|
|
458
442
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soyaxell09/zenbot-scraper",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
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",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"author": "AxelDev09",
|
|
52
52
|
"license": "MIT",
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@distube/ytdl-core": "^4.16.0",
|
|
55
54
|
"axios": "^1.6.0",
|
|
56
55
|
"cheerio": "^1.0.0",
|
|
56
|
+
"node-fetch": "^3.3.2",
|
|
57
57
|
"form-data": "^4.0.0"
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|
package/src/index.js
CHANGED
|
@@ -5,20 +5,20 @@
|
|
|
5
5
|
* Deja los créditos we 🗣️
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
export { ytInfo, ytDownload, ytSearch }
|
|
9
|
-
export { ytInfoV2, ytDownloadV2, getFileSizeV2 } from './scrapers/youtubev2.js'
|
|
8
|
+
export { ytInfo, ytDownload, ytSearch, getFileSize } from './scrapers/youtube.js'
|
|
10
9
|
export { tiktokInfo, tiktokDownload } from './scrapers/tiktok.js'
|
|
11
|
-
export { igDownload }
|
|
10
|
+
export { igDownload, igReelDownload, igStalk, igStories } from './scrapers/instagram.js'
|
|
11
|
+
export { threadsDownload } from './scrapers/threads.js'
|
|
12
12
|
export { spotidownTrack } from './scrapers/spotidown.js'
|
|
13
13
|
export { fbDownload } from './scrapers/facebook.js'
|
|
14
14
|
export { tweetInfo, tweetDownload } from './scrapers/twitter.js'
|
|
15
15
|
export { mediafireInfo } from './scrapers/mediafire.js'
|
|
16
16
|
export { githubInfo, githubRelease, githubContents, githubSearch } from './scrapers/github.js'
|
|
17
17
|
export { apkSearch, apkInfo } from './scrapers/apk.js'
|
|
18
|
-
export { gdriveInfo, gdriveDownload }
|
|
18
|
+
export { gdriveInfo, gdriveDownload } from './scrapers/gdrive.js'
|
|
19
19
|
export { googleSearch } from './search/google.js'
|
|
20
20
|
export { spotify } from './search/spotify.js'
|
|
21
|
-
export { giphy }
|
|
21
|
+
export { giphy, gifNext, giphyBuffer } from './search/giphy.js'
|
|
22
22
|
export { pinsearch, pinimg, pinvid } from './search/pinterest.js'
|
|
23
23
|
export { stickerSearch } from './search/stickersearch.js'
|
|
24
24
|
export { animeImage } from './search/anime.js'
|
|
@@ -38,6 +38,6 @@ export { phSearch } from './nsfw/
|
|
|
38
38
|
export { phDownload, phDownloadBuffer } from './nsfw/phdl.js'
|
|
39
39
|
export { xvideosSearch } from './nsfw/xvideossearch.js'
|
|
40
40
|
export { xvideosDownload } from './nsfw/xvideosdl.js'
|
|
41
|
-
export {
|
|
41
|
+
export { rule34Random } from './nsfw/rule34.js'
|
|
42
42
|
export { xhamsterSearch } from './nsfw/xhamstersearch.js'
|
|
43
43
|
export { xhamsterDownload, xhamsterDownloadBuffer } from './nsfw/xhammerdl.js'
|
package/src/nsfw/index.js
CHANGED
|
@@ -11,7 +11,6 @@ export { phSearch } from './phsearch.js'
|
|
|
11
11
|
export { phDownload, phDownloadBuffer } from './phdl.js'
|
|
12
12
|
export { xvideosSearch } from './xvideossearch.js'
|
|
13
13
|
export { xvideosDownload } from './xvideosdl.js'
|
|
14
|
-
export {
|
|
14
|
+
export { rule34Random } from './rule34.js'
|
|
15
15
|
export { xhamsterSearch } from './xhamstersearch.js'
|
|
16
|
-
export { xhamsterDownload, xhamsterDownloadBuffer } from './xhammerdl.js'
|
|
17
|
-
export { hentaiImgSearch, hentaiImgRandom } from './hentaiimg.js'
|
|
16
|
+
export { xhamsterDownload, xhamsterDownloadBuffer } from './xhammerdl.js'
|
package/src/nsfw/rule34.js
CHANGED
|
@@ -10,29 +10,6 @@ import * as cheerio from 'cheerio';
|
|
|
10
10
|
|
|
11
11
|
const UA = 'Mozilla/5.0 (Linux; Android 11; Redmi Note 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36';
|
|
12
12
|
|
|
13
|
-
function mapYande(p) {
|
|
14
|
-
return {
|
|
15
|
-
id: String(p.id),
|
|
16
|
-
url: p.sample_url || p.file_url || '',
|
|
17
|
-
full: p.file_url || '',
|
|
18
|
-
preview: p.preview_url || '',
|
|
19
|
-
tags: p.tags || '',
|
|
20
|
-
score: p.score || 0,
|
|
21
|
-
width: p.width || 0,
|
|
22
|
-
height: p.height || 0
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
async function yandereSearch(tags, limit = 10) {
|
|
27
|
-
const { data } = await axios.get('https://yande.re/post.json', {
|
|
28
|
-
params: { tags, limit },
|
|
29
|
-
headers: { 'User-Agent': UA },
|
|
30
|
-
timeout: 12000
|
|
31
|
-
});
|
|
32
|
-
if (!Array.isArray(data) || !data.length) return [];
|
|
33
|
-
return data.map(mapYande);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
13
|
function parsePaheal(xml) {
|
|
37
14
|
const $ = cheerio.load(xml, { xmlMode: true });
|
|
38
15
|
const items = [];
|
|
@@ -53,22 +30,6 @@ function parsePaheal(xml) {
|
|
|
53
30
|
return items;
|
|
54
31
|
}
|
|
55
32
|
|
|
56
|
-
async function pahealSearch(tags, limit = 10) {
|
|
57
|
-
const { data } = await axios.get('https://rule34.paheal.net/api/danbooru/find_posts', {
|
|
58
|
-
params: { tags, limit },
|
|
59
|
-
headers: { 'User-Agent': UA },
|
|
60
|
-
timeout: 12000
|
|
61
|
-
});
|
|
62
|
-
return parsePaheal(data);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export async function rule34Search(tags, limit = 10) {
|
|
66
|
-
let items = await yandereSearch(tags, limit);
|
|
67
|
-
if (!items.length) items = await pahealSearch(tags, limit);
|
|
68
|
-
if (!items.length) throw new Error('Sin resultados para esos tags.');
|
|
69
|
-
return items;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
33
|
export async function rule34Random(tags = null) {
|
|
73
34
|
for (let intento = 0; intento < 3; intento++) {
|
|
74
35
|
const pid = Math.floor(Math.random() * 5);
|
package/src/scrapers/apk.js
CHANGED
|
@@ -5,52 +5,51 @@
|
|
|
5
5
|
* Deja los créditos we 🗣️
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import axios from 'axios'
|
|
9
|
-
import * as cheerio from 'cheerio'
|
|
8
|
+
import axios from 'axios';
|
|
9
|
+
import * as cheerio from 'cheerio';
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const UA = 'Mozilla/5.0 (Linux; Android 11; Redmi Note 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36';
|
|
12
|
+
const BASE = 'https://apkpure.net';
|
|
13
|
+
const DL_BASE = 'https://d.apkpure.net';
|
|
14
|
+
const HEADERS = { 'User-Agent': UA, 'Referer': BASE };
|
|
14
15
|
|
|
15
16
|
function extractPkg(href) {
|
|
16
|
-
const m = href?.match(/\/((?:com|org|net|io|co)\.[a-z0-9.]+)(?:\/|$)/i)
|
|
17
|
-
return m ? m[1] : ''
|
|
17
|
+
const m = href?.match(/\/((?:com|org|net|io|co)\.[a-z0-9.]+)(?:\/|$)/i);
|
|
18
|
+
return m ? m[1] : '';
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return
|
|
21
|
+
function parsePageData(data) {
|
|
22
|
+
try {
|
|
23
|
+
const m = data.match(/window\.apkpure\s*=\s*\{pageData:\s*(\{.*?\})\s*[,;]/s);
|
|
24
|
+
if (m) return JSON.parse(m[1]);
|
|
25
|
+
} catch {}
|
|
26
|
+
return null;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
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
|
|
30
|
+
if (!query?.trim()) throw new Error('Query vacío');
|
|
37
31
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
const { data } = await axios.get(`${BASE}/search?q=${encodeURIComponent(query)}`, {
|
|
33
|
+
headers: HEADERS, timeout: 15000
|
|
34
|
+
});
|
|
35
|
+
const $ = cheerio.load(data);
|
|
36
|
+
const results = [];
|
|
37
|
+
const seen = new Set();
|
|
42
38
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
.map(a => $(a).attr('href'))
|
|
46
|
-
.find(h => extractPkg(h)) || ''
|
|
39
|
+
$('.search-brand-container').each((_, el) => {
|
|
40
|
+
if (results.length >= limit) return false;
|
|
47
41
|
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
const name = $(el).find('a.top').first().text().trim();
|
|
43
|
+
const dev = $(el).find('a.developer').first().text().trim();
|
|
44
|
+
const date = $(el).find('span.time').first().text().trim();
|
|
45
|
+
const icon = $(el).find('img.app-icon-img').first().attr('data-original') || '';
|
|
46
|
+
const appHref = $(el).find('a.top').first().attr('href') || '';
|
|
47
|
+
const pkg = extractPkg(appHref);
|
|
51
48
|
|
|
52
|
-
|
|
49
|
+
if (!name || !pkg || seen.has(pkg)) return;
|
|
50
|
+
seen.add(pkg);
|
|
53
51
|
|
|
52
|
+
const appUrl = appHref.startsWith('http') ? appHref : `${BASE}${appHref}`;
|
|
54
53
|
results.push({
|
|
55
54
|
name,
|
|
56
55
|
developer: dev,
|
|
@@ -58,55 +57,50 @@ export async function apkSearch(query, limit = 5) {
|
|
|
58
57
|
date,
|
|
59
58
|
icon,
|
|
60
59
|
appUrl,
|
|
61
|
-
dlUrl:
|
|
62
|
-
})
|
|
63
|
-
})
|
|
60
|
+
dlUrl: `${DL_BASE}/b/APK/${pkg}?version=latest`,
|
|
61
|
+
});
|
|
62
|
+
});
|
|
64
63
|
|
|
65
|
-
if (!results.length) throw new Error('No se encontraron resultados')
|
|
66
|
-
return results
|
|
64
|
+
if (!results.length) throw new Error('No se encontraron resultados');
|
|
65
|
+
return results;
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
export async function apkInfo(pkgOrUrl) {
|
|
70
|
-
let pkg = pkgOrUrl
|
|
71
|
-
if (
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
})
|
|
69
|
+
let pkg = pkgOrUrl.includes('apkpure') ? extractPkg(pkgOrUrl) : pkgOrUrl;
|
|
70
|
+
if (!pkg) pkg = pkgOrUrl;
|
|
71
|
+
|
|
72
|
+
const shortName = pkg.split('.').slice(-2).join('-').toLowerCase();
|
|
73
|
+
|
|
74
|
+
const { data } = await axios.get(`${BASE}/${shortName}/${pkg}/download`, {
|
|
75
|
+
headers: HEADERS, timeout: 15000, validateStatus: () => true
|
|
76
|
+
});
|
|
77
|
+
const $ = cheerio.load(data);
|
|
78
|
+
const pageData = parsePageData(data);
|
|
79
|
+
|
|
80
|
+
const name = pageData?.versionName
|
|
81
|
+
? $('title').text().split(' APK')[0].replace('Download ', '').trim()
|
|
82
|
+
: $('h1, .title-like').first().text().trim();
|
|
83
|
+
const version = pageData?.versionName || $('[class*="version"]').first().text().trim().match(/[\d.]+/)?.[0] || '';
|
|
84
|
+
const size = $('[class*="size"]').first().text().trim();
|
|
85
|
+
const icon = $('img.icon, img[itemprop="image"]').first().attr('src') || '';
|
|
86
|
+
const dev = $('[class*="developer"], .dev-info, [itemprop="author"]').first().text().trim();
|
|
87
|
+
|
|
88
|
+
const dlLinks = [];
|
|
89
|
+
$(`a[href*="d.apkpure.net"]`).each((_, a) => {
|
|
90
|
+
const href = $(a).attr('href') || '';
|
|
91
|
+
if (href.includes(pkg)) dlLinks.push(href);
|
|
92
|
+
});
|
|
101
93
|
|
|
102
94
|
return {
|
|
103
95
|
name,
|
|
104
96
|
developer: dev,
|
|
105
97
|
pkg,
|
|
106
|
-
|
|
98
|
+
version,
|
|
99
|
+
size,
|
|
107
100
|
icon,
|
|
108
|
-
download:
|
|
101
|
+
download: `${DL_BASE}/b/APK/${pkg}?version=latest`,
|
|
102
|
+
downloadXapk: `${DL_BASE}/b/XAPK/${pkg}?version=latest`,
|
|
109
103
|
dlLinks: [...new Set(dlLinks)],
|
|
110
|
-
url:
|
|
111
|
-
}
|
|
104
|
+
url: `${BASE}/${shortName}/${pkg}`,
|
|
105
|
+
};
|
|
112
106
|
}
|
package/src/scrapers/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { ytInfo, ytDownload, ytSearch }
|
|
2
|
-
export { ytInfoV2, ytDownloadV2, getFileSizeV2 } from './youtubev2.js'
|
|
1
|
+
export { ytInfo, ytDownload, ytSearch, getFileSize } from './youtube.js'
|
|
3
2
|
export { tiktokInfo, tiktokDownload } from './tiktok.js'
|
|
4
3
|
export { fbDownload } from './facebook.js'
|
|
5
4
|
export { tweetInfo, tweetDownload } from './twitter.js'
|
|
@@ -7,5 +6,6 @@ export { mediafireInfo } from './media
|
|
|
7
6
|
export { githubInfo, githubRelease, githubContents, githubSearch } from './github.js'
|
|
8
7
|
export { apkSearch, apkInfo } from './apk.js'
|
|
9
8
|
export { gdriveInfo, gdriveDownload } from './gdrive.js'
|
|
10
|
-
export { igDownload }
|
|
9
|
+
export { igDownload, igReelDownload, igStalk, igStories } from './instagram.js'
|
|
10
|
+
export { threadsDownload } from './threads.js'
|
|
11
11
|
export { spotidownTrack } from './spotidown.js'
|