abot-scraper 1.6.0 → 1.6.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 +208 -49
- package/dist/index.cjs +114 -214
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -23
- package/dist/index.d.ts +6 -23
- package/dist/index.js +114 -214
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +1 -0
package/dist/index.cjs
CHANGED
@@ -172,7 +172,7 @@ var Downloader = class {
|
|
172
172
|
};
|
173
173
|
this.generator = new Generator();
|
174
174
|
}
|
175
|
-
async
|
175
|
+
async facebookDownloader(url) {
|
176
176
|
try {
|
177
177
|
const headers = {
|
178
178
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0",
|
@@ -251,72 +251,52 @@ var Downloader = class {
|
|
251
251
|
};
|
252
252
|
}
|
253
253
|
}
|
254
|
-
async
|
255
|
-
const payload = {
|
256
|
-
username
|
257
|
-
};
|
258
|
-
const headers = {
|
259
|
-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/",
|
260
|
-
accept: "application/json, text/plain, */*",
|
261
|
-
"accept-language": "en-US,en;q=0.9,ar;q=0.8,id;q=0.7,vi;q=0.6",
|
262
|
-
"content-type": "application/json",
|
263
|
-
priority: "u=1, i",
|
264
|
-
"sec-ch-ua": '"Microsoft Edge";v="137", "Chromium";v="137", "Not/A)Brand";v="24"',
|
265
|
-
"sec-ch-ua-mobile": "?0",
|
266
|
-
"sec-ch-ua-platform": '"Windows"',
|
267
|
-
"sec-fetch-dest": "empty",
|
268
|
-
"sec-fetch-mode": "cors",
|
269
|
-
"sec-fetch-site": "same-origin",
|
270
|
-
Referer: "https://storyviewer.com/",
|
271
|
-
"Referrer-Policy": "strict-origin-when-cross-origin"
|
272
|
-
};
|
254
|
+
async instagramDownloader(url) {
|
273
255
|
try {
|
256
|
+
const payload = new URLSearchParams({ url });
|
257
|
+
const headers = {
|
258
|
+
accept: "*/*",
|
259
|
+
"accept-language": "en-US,en;q=0.9,ar;q=0.8,id;q=0.7,vi;q=0.6",
|
260
|
+
"content-type": "application/x-www-form-urlencoded",
|
261
|
+
priority: "u=1, i",
|
262
|
+
"sec-ch-ua": '"Not)A;Brand";v="8", "Chromium";v="138", "Microsoft Edge";v="138"',
|
263
|
+
"sec-ch-ua-mobile": "?0",
|
264
|
+
"sec-ch-ua-platform": '"Windows"',
|
265
|
+
"sec-fetch-dest": "empty",
|
266
|
+
"sec-fetch-mode": "cors",
|
267
|
+
"sec-fetch-site": "same-origin"
|
268
|
+
};
|
274
269
|
const response = await import_axios.default.post(
|
275
|
-
|
270
|
+
"https://snapinsta.llc/process",
|
276
271
|
payload,
|
277
272
|
{ headers }
|
278
273
|
);
|
279
|
-
const
|
280
|
-
const
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
274
|
+
const $ = cheerio.load(response.data);
|
275
|
+
const downloadItems = [];
|
276
|
+
$(".download-item").each((_index, element) => {
|
277
|
+
const $element = $(element);
|
278
|
+
const previewImg = $element.find(".media-box img").attr("src");
|
279
|
+
const downloadLink = $element.find(".download-media").attr("href");
|
280
|
+
const downloadText = $element.find(".download-media").text().trim();
|
281
|
+
const isVideo = downloadText.toLowerCase().includes("video") || $element.find(".icon-downvid").length > 0;
|
282
|
+
if (downloadLink) {
|
283
|
+
const mediaItem = {
|
284
|
+
type: isVideo ? "video" : "image",
|
285
|
+
url: downloadLink
|
286
|
+
};
|
287
|
+
if (previewImg) {
|
288
|
+
mediaItem.preview = previewImg;
|
289
|
+
}
|
290
|
+
downloadItems.push(mediaItem);
|
287
291
|
}
|
288
|
-
};
|
289
|
-
} catch (error) {
|
290
|
-
return {
|
291
|
-
creator: global.creator,
|
292
|
-
status: false,
|
293
|
-
msg: error instanceof Error ? error.message : "Unknown error"
|
294
|
-
};
|
295
|
-
}
|
296
|
-
}
|
297
|
-
async instagram(url) {
|
298
|
-
try {
|
299
|
-
const config = new URLSearchParams({
|
300
|
-
url,
|
301
|
-
new: "2",
|
302
|
-
lang: "en",
|
303
|
-
app: ""
|
304
292
|
});
|
305
|
-
|
306
|
-
|
307
|
-
}
|
308
|
-
const response = await import_axios.default.post(
|
309
|
-
"https://snapinsta.app/get-data.php",
|
310
|
-
config,
|
311
|
-
{ headers }
|
312
|
-
);
|
313
|
-
const downloadLinks = response.data.files.map(
|
314
|
-
(file) => file.__type === "GraphVideo" ? { type: "video", url: file.video_url || "" } : file.__type === "GraphImage" ? { type: "image", url: file.download_url || "" } : null
|
315
|
-
).filter((link) => link !== null);
|
293
|
+
if (downloadItems.length === 0) {
|
294
|
+
throw new Error("No media items found in the response.");
|
295
|
+
}
|
316
296
|
return {
|
317
297
|
creator: global.creator,
|
318
298
|
status: 200,
|
319
|
-
result:
|
299
|
+
result: downloadItems
|
320
300
|
};
|
321
301
|
} catch (error) {
|
322
302
|
return {
|
@@ -327,60 +307,6 @@ var Downloader = class {
|
|
327
307
|
}
|
328
308
|
}
|
329
309
|
async youtubeDownloader(url) {
|
330
|
-
try {
|
331
|
-
const config = import_qs.default.stringify({
|
332
|
-
url,
|
333
|
-
q_auto: 0,
|
334
|
-
ajax: 1,
|
335
|
-
lang: "en"
|
336
|
-
});
|
337
|
-
const headers = {
|
338
|
-
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
|
339
|
-
};
|
340
|
-
const response = await import_axios.default.post(
|
341
|
-
"https://yt1s.net/ajax?retry=undefined&platform=youtube",
|
342
|
-
config,
|
343
|
-
{ headers }
|
344
|
-
);
|
345
|
-
const $ = cheerio.load(response.data.result);
|
346
|
-
const title = $(".caption b").text().trim();
|
347
|
-
const downloadLinks = {
|
348
|
-
"480p": $('a[data-fquality="480p"]').attr("href") || "",
|
349
|
-
"720p": $('a[data-fquality="720p"]').attr("href") || "",
|
350
|
-
"1080p": $('a[data-fquality="1080p"]').attr("href") || ""
|
351
|
-
};
|
352
|
-
const thumbnailUrl = $(".thumbnail.cover img").attr("src");
|
353
|
-
const mp3ConvertElement = $("#convert-mp3 a");
|
354
|
-
const hrefAttr = mp3ConvertElement.attr("href");
|
355
|
-
if (!hrefAttr) throw new Error("MP3 conversion link not found.");
|
356
|
-
const mp3ConvertTokenMatch = hrefAttr.match(
|
357
|
-
/mp3_convert_task\('(\d+)',\s*'([^']+)'\)/
|
358
|
-
);
|
359
|
-
if (!mp3ConvertTokenMatch)
|
360
|
-
throw new Error("MP3 conversion token not found.");
|
361
|
-
const mp3ConvertToken = mp3ConvertTokenMatch[2];
|
362
|
-
const mp3Response = await import_axios.default.get(
|
363
|
-
`https://api.fabdl.com/youtube/mp3-convert-task?token=${mp3ConvertToken}`
|
364
|
-
);
|
365
|
-
return {
|
366
|
-
creator: global.creator,
|
367
|
-
status: 200,
|
368
|
-
result: {
|
369
|
-
title,
|
370
|
-
thumbnail: thumbnailUrl || "",
|
371
|
-
downloadLinks,
|
372
|
-
mp3DownloadUrl: `https://api.fabdl.com${mp3Response.data.result.download_url}`
|
373
|
-
}
|
374
|
-
};
|
375
|
-
} catch (error) {
|
376
|
-
return {
|
377
|
-
creator: global.creator,
|
378
|
-
status: false,
|
379
|
-
msg: error instanceof Error ? error.message : "Unknown error"
|
380
|
-
};
|
381
|
-
}
|
382
|
-
}
|
383
|
-
async youtubeDownloaderV2(url) {
|
384
310
|
try {
|
385
311
|
const timestamp = this.generator.generateTimeStampYoutubeDL();
|
386
312
|
const footer = this.generator.generateFooterYoutubeDL(timestamp, url);
|
@@ -479,76 +405,6 @@ var cheerio2 = __toESM(require("cheerio"), 1);
|
|
479
405
|
global.creator = "@abotscraper \u2013 ahmuq";
|
480
406
|
var Search = class {
|
481
407
|
constructor() {
|
482
|
-
this.ytPlay = (text) => {
|
483
|
-
return new Promise((resolve, reject) => {
|
484
|
-
const configd = {
|
485
|
-
k_query: text,
|
486
|
-
k_page: "mp3",
|
487
|
-
q_auto: 1
|
488
|
-
};
|
489
|
-
const headerss = {
|
490
|
-
"sec-ch-ua": '" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"',
|
491
|
-
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
492
|
-
Cookie: 'PHPSESSID=6jo2ggb63g5mjvgj45f612ogt7; _ga=GA1.2.405896420.1625200423; _gid=GA1.2.2135261581.1625200423; _PN_SBSCRBR_FALLBACK_DENIED=1625200785624; MarketGidStorage={"0":{},"C702514":{"page":5,"time":1625200846733}}'
|
493
|
-
};
|
494
|
-
(0, import_axios2.default)("https://www.y2mate.com/mates/analyzeV2/ajax", {
|
495
|
-
method: "POST",
|
496
|
-
data: new URLSearchParams(Object.entries(configd)),
|
497
|
-
headers: headerss
|
498
|
-
}).then(({ data }) => {
|
499
|
-
const v = data.vitems;
|
500
|
-
const v2 = v[Math.floor(Math.random() * v.length)].v;
|
501
|
-
const url = "https://www.youtube.com/watch?v=" + v2;
|
502
|
-
const config = {
|
503
|
-
k_query: "https://www.youtube.be/" + url,
|
504
|
-
k_page: "mp3",
|
505
|
-
hl: "en",
|
506
|
-
q_auto: 1
|
507
|
-
};
|
508
|
-
(0, import_axios2.default)("https://www.y2mate.com/mates/en68/analyze/ajax", {
|
509
|
-
method: "POST",
|
510
|
-
data: new URLSearchParams({
|
511
|
-
url: "https://www.youtube.be/" + url,
|
512
|
-
q_auto: "0",
|
513
|
-
ajax: "1"
|
514
|
-
}),
|
515
|
-
headers: headerss
|
516
|
-
}).then(({ data: data2 }) => {
|
517
|
-
const $ = cheerio2.load(data2.result);
|
518
|
-
const img = $("div.thumbnail.cover > a > img").attr("src");
|
519
|
-
(0, import_axios2.default)("https://www.y2mate.com/mates/analyzeV2/ajax", {
|
520
|
-
method: "POST",
|
521
|
-
data: new URLSearchParams(Object.entries(config)),
|
522
|
-
headers: headerss
|
523
|
-
}).then(({ data: data3 }) => {
|
524
|
-
const convertConfig = {
|
525
|
-
vid: data3.vid,
|
526
|
-
k: data3.links.mp3.mp3128.k
|
527
|
-
};
|
528
|
-
const size = data3.links.mp3.mp3128.size;
|
529
|
-
(0, import_axios2.default)("https://www.y2mate.com/mates/convertV2/index", {
|
530
|
-
method: "POST",
|
531
|
-
data: new URLSearchParams(Object.entries(convertConfig)),
|
532
|
-
headers: headerss
|
533
|
-
}).then((response) => {
|
534
|
-
resolve({
|
535
|
-
creator: global.creator,
|
536
|
-
status: 200,
|
537
|
-
result: {
|
538
|
-
status: response.data.status,
|
539
|
-
title: response.data.title,
|
540
|
-
ftype: response.data.ftype,
|
541
|
-
thumb: img || "",
|
542
|
-
size_mp3: size,
|
543
|
-
link: response.data.dlink
|
544
|
-
}
|
545
|
-
});
|
546
|
-
}).catch(reject);
|
547
|
-
});
|
548
|
-
});
|
549
|
-
}).catch(reject);
|
550
|
-
});
|
551
|
-
};
|
552
408
|
this.wallpaper = (title, page = "1") => {
|
553
409
|
return new Promise((resolve, reject) => {
|
554
410
|
import_axios2.default.get(
|
@@ -603,6 +459,49 @@ var Search = class {
|
|
603
459
|
});
|
604
460
|
};
|
605
461
|
}
|
462
|
+
async igStory(username) {
|
463
|
+
const payload = {
|
464
|
+
username
|
465
|
+
};
|
466
|
+
const headers = {
|
467
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/",
|
468
|
+
accept: "application/json, text/plain, */*",
|
469
|
+
"accept-language": "en-US,en;q=0.9,ar;q=0.8,id;q=0.7,vi;q=0.6",
|
470
|
+
"content-type": "application/json",
|
471
|
+
priority: "u=1, i",
|
472
|
+
"sec-ch-ua": '"Microsoft Edge";v="137", "Chromium";v="137", "Not/A)Brand";v="24"',
|
473
|
+
"sec-ch-ua-mobile": "?0",
|
474
|
+
"sec-ch-ua-platform": '"Windows"',
|
475
|
+
"sec-fetch-dest": "empty",
|
476
|
+
"sec-fetch-mode": "cors",
|
477
|
+
"sec-fetch-site": "same-origin",
|
478
|
+
Referer: "https://storyviewer.com/",
|
479
|
+
"Referrer-Policy": "strict-origin-when-cross-origin"
|
480
|
+
};
|
481
|
+
try {
|
482
|
+
const response = await import_axios2.default.post(
|
483
|
+
`https://storyviewer.com/api/data`,
|
484
|
+
payload,
|
485
|
+
{ headers }
|
486
|
+
);
|
487
|
+
const data = response.data;
|
488
|
+
const sources = data.stories.map((story) => story.source);
|
489
|
+
return {
|
490
|
+
creator: global.creator,
|
491
|
+
status: 200,
|
492
|
+
result: {
|
493
|
+
user_info: data.user_info,
|
494
|
+
links: sources
|
495
|
+
}
|
496
|
+
};
|
497
|
+
} catch (error) {
|
498
|
+
return {
|
499
|
+
creator: global.creator,
|
500
|
+
status: false,
|
501
|
+
msg: error instanceof Error ? error.message : "Unknown error"
|
502
|
+
};
|
503
|
+
}
|
504
|
+
}
|
606
505
|
async sfileSearch(query, page = 1) {
|
607
506
|
try {
|
608
507
|
const response = await import_axios2.default.get(
|
@@ -690,63 +589,64 @@ var Tools = class {
|
|
690
589
|
constructor() {
|
691
590
|
this.removeBackground = (image) => {
|
692
591
|
return new Promise((resolve, reject) => {
|
693
|
-
const
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
image
|
708
|
-
};
|
709
|
-
import_axios3.default.post("https://aibackgroundremover.org/api/remove-bg", payload, {
|
710
|
-
headers
|
711
|
-
}).then((CreateJobResponse) => {
|
712
|
-
if (CreateJobResponse.status !== 200) {
|
592
|
+
const form = new import_form_data.default();
|
593
|
+
form.append("image_file", image, "blob");
|
594
|
+
const productSerial = Generator.getFingerprint();
|
595
|
+
import_axios3.default.post("https://api.ezremove.ai/api/ez-remove/background-remove/create-job", form, {
|
596
|
+
headers: {
|
597
|
+
...form.getHeaders(),
|
598
|
+
"product-serial": productSerial,
|
599
|
+
"Referer": "https://ezremove.ai/",
|
600
|
+
"Origin": "https://ezremove.ai",
|
601
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0"
|
602
|
+
}
|
603
|
+
}).then((createJobResponse) => {
|
604
|
+
var _a, _b;
|
605
|
+
if (createJobResponse.data.code !== 1e5) {
|
713
606
|
reject({
|
714
607
|
creator: global.creator,
|
715
608
|
status: false,
|
716
|
-
error: `
|
609
|
+
error: `Job creation failed: ${((_a = createJobResponse.data.message) == null ? void 0 : _a.en) || ((_b = createJobResponse.data.message) == null ? void 0 : _b.id) || "Unknown error"}`
|
717
610
|
});
|
718
611
|
return;
|
719
612
|
}
|
720
|
-
const jobId =
|
721
|
-
const checkJobStatus = () => {
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
613
|
+
const jobId = createJobResponse.data.result.job_id;
|
614
|
+
const checkJobStatus = async () => {
|
615
|
+
try {
|
616
|
+
const jobResponse = await import_axios3.default.get(`https://api.ezremove.ai/api/ez-remove/background-remove/get-job/${jobId}`, {
|
617
|
+
headers: {
|
618
|
+
"authorization": "",
|
619
|
+
"product-serial": productSerial,
|
620
|
+
"Referer": "https://ezremove.ai/",
|
621
|
+
"Origin": "https://ezremove.ai"
|
622
|
+
}
|
623
|
+
});
|
624
|
+
const { code, result, message } = jobResponse.data;
|
625
|
+
if (code === 1e5 && result && result.output) {
|
726
626
|
resolve({
|
727
627
|
creator: global.creator,
|
728
628
|
status: true,
|
729
629
|
result: {
|
730
630
|
job_id: jobId,
|
731
|
-
image_url:
|
631
|
+
image_url: result.output[0]
|
732
632
|
}
|
733
633
|
});
|
734
|
-
} else if (
|
634
|
+
} else if (code === 300001) {
|
735
635
|
setTimeout(checkJobStatus, 3e3);
|
736
636
|
} else {
|
737
637
|
reject({
|
738
638
|
creator: global.creator,
|
739
639
|
status: false,
|
740
|
-
error: `
|
640
|
+
error: `Job failed: ${(message == null ? void 0 : message.en) || (message == null ? void 0 : message.id) || "Unknown error"} (Code: ${code})`
|
741
641
|
});
|
742
642
|
}
|
743
|
-
}
|
643
|
+
} catch (error) {
|
744
644
|
reject({
|
745
645
|
creator: global.creator,
|
746
646
|
status: false,
|
747
|
-
error: error.message
|
647
|
+
error: `Status check failed: ${error instanceof Error ? error.message : "Unknown error"}`
|
748
648
|
});
|
749
|
-
}
|
649
|
+
}
|
750
650
|
};
|
751
651
|
checkJobStatus();
|
752
652
|
}).catch((error) => {
|