Spaces:
Paused
Paused
Update index.js
Browse files
index.js
CHANGED
|
@@ -1032,7 +1032,54 @@ app.get('/iwara/download', async (req, res) => {
|
|
| 1032 |
}
|
| 1033 |
});
|
| 1034 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1035 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1036 |
|
| 1037 |
/*******************************/
|
| 1038 |
// Fungsi untuk ping website
|
|
|
|
| 1032 |
}
|
| 1033 |
});
|
| 1034 |
|
| 1035 |
+
async function XnxxDown(inputUrl) {
|
| 1036 |
+
const browser = await puppeteer.launch({
|
| 1037 |
+
headless: true,
|
| 1038 |
+
args: ['--no-sandbox', '--disable-setuid-sandbox']
|
| 1039 |
+
});
|
| 1040 |
+
const page = await browser.newPage();
|
| 1041 |
+
await page.setUserAgent("Mozilla/5.0 (Linux; Android 10; SM-G965U Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/114.0.5735.141 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/420.0.0.32.61;]");
|
| 1042 |
+
await page.goto("https://www.xnxxvideodownload.com/", { waitUntil: 'domcontentloaded' });
|
| 1043 |
+
await page.type('#ytUrl', inputUrl);
|
| 1044 |
+
await page.click('#convBtn');
|
| 1045 |
+
await page.waitForNavigation({ waitUntil: 'networkidle0' });
|
| 1046 |
+
await page.waitForSelector("body > main > section.e.j.d2.dsection > div > div.thumbdiv > img");
|
| 1047 |
+
const thumbnail = await page.$eval(
|
| 1048 |
+
"body > main > section.e.j.d2.dsection > div > div.thumbdiv > img",
|
| 1049 |
+
el => el.src || null
|
| 1050 |
+
);
|
| 1051 |
+
const quality = await page.$eval(
|
| 1052 |
+
"#dtable > table > tbody > tr > td:nth-child(1)",
|
| 1053 |
+
el => el.textContent.trim() || null
|
| 1054 |
+
);
|
| 1055 |
+
const fileExt = await page.$eval(
|
| 1056 |
+
"#dtable > table > tbody > tr > td:nth-child(2)",
|
| 1057 |
+
el => el.textContent.trim() || null
|
| 1058 |
+
);
|
| 1059 |
+
const downloadUrl = await page.$eval(
|
| 1060 |
+
"#dtable > table > tbody > tr > td:nth-child(3) > a",
|
| 1061 |
+
el => el.href || null
|
| 1062 |
+
);
|
| 1063 |
+
await browser.close();
|
| 1064 |
|
| 1065 |
+
return {
|
| 1066 |
+
thumbnail: thumbnail || 'Thumbnail not available',
|
| 1067 |
+
quality: quality || 'Quality not available',
|
| 1068 |
+
fileExt: fileExt || 'File extension not available',
|
| 1069 |
+
downloadUrl: downloadUrl || 'Download URL not available'
|
| 1070 |
+
};
|
| 1071 |
+
}
|
| 1072 |
+
|
| 1073 |
+
app.get('/xnxx/download', async (req, res) => {
|
| 1074 |
+
const { url } = req.query;
|
| 1075 |
+
if (!url) return res.status(400).json({ error: 'Parameter url is required' });
|
| 1076 |
+
try {
|
| 1077 |
+
const base64Result = await XnxxDown(url);
|
| 1078 |
+
res.json(base64Result); // Mengirimkan buffer gambar sebagai respons
|
| 1079 |
+
} catch (error) {
|
| 1080 |
+
res.status(500).send(error);
|
| 1081 |
+
}
|
| 1082 |
+
});
|
| 1083 |
|
| 1084 |
/*******************************/
|
| 1085 |
// Fungsi untuk ping website
|