Update index.js
Browse files
index.js
CHANGED
|
@@ -25,50 +25,28 @@ const post = async (url, form, headers = {}) => {
|
|
| 25 |
};
|
| 26 |
|
| 27 |
//INDOWN
|
| 28 |
-
async function igdl(
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
let $ = cheerio.load(data)
|
| 51 |
-
let result = []
|
| 52 |
-
let __$ = cheerio.load($("#result").html())
|
| 53 |
-
__$("video").each(function () {
|
| 54 |
-
let $$ = $(this)
|
| 55 |
-
result.push({
|
| 56 |
-
author: creator,
|
| 57 |
-
type: "video",
|
| 58 |
-
thumbnail: $$.attr("poster"),
|
| 59 |
-
url: $$.find("source").attr("src"),
|
| 60 |
-
})
|
| 61 |
-
})
|
| 62 |
-
__$("img").each(function () {
|
| 63 |
-
let $$ = $(this)
|
| 64 |
-
result.push({
|
| 65 |
-
author: creator,
|
| 66 |
-
type: "image",
|
| 67 |
-
url: $$.attr("src"),
|
| 68 |
-
})
|
| 69 |
-
})
|
| 70 |
-
|
| 71 |
-
return result
|
| 72 |
}
|
| 73 |
|
| 74 |
//FBDL
|
|
|
|
| 25 |
};
|
| 26 |
|
| 27 |
//INDOWN
|
| 28 |
+
async function igdl(query) {
|
| 29 |
+
let cloudscraper = await import('cloudscraper')
|
| 30 |
+
url_dl = [];
|
| 31 |
+
let headers = {
|
| 32 |
+
'Accept': '*/*',
|
| 33 |
+
'Accept-Language': 'en-US,en;q=0.9',
|
| 34 |
+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
| 35 |
+
'Referer': 'https://saveig.app/',
|
| 36 |
+
'Referrer-Policy': 'strict-origin-when-cross-origin',
|
| 37 |
+
'X-Requested-With': 'XMLHttpRequest'
|
| 38 |
+
}
|
| 39 |
+
let options = {
|
| 40 |
+
method: 'POST',
|
| 41 |
+
uri: 'https://saveig.app/api/ajaxSearch',
|
| 42 |
+
headers: headers,
|
| 43 |
+
formData: {
|
| 44 |
+
q: query
|
| 45 |
+
}
|
| 46 |
+
}
|
| 47 |
+
ch = cheerio.load(JSON.parse(await cloudscraper(options)).data);
|
| 48 |
+
ch('.download-items__btn').each(function(a,b) { url_dl.push(ch(b).find('a').attr('href'))})
|
| 49 |
+
return url_dl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
}
|
| 51 |
|
| 52 |
//FBDL
|