Nexchan commited on
Commit
343605d
·
verified ·
1 Parent(s): b56131c

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +11 -2
index.js CHANGED
@@ -376,14 +376,23 @@ app.get('/html', async (req, res) => {
376
  async function XnDl(url) {
377
  const browser = await puppeteer.launch({
378
  headless: true,
379
- args: ['--no-sandbox', '--disable-setuid-sandbox']
 
380
  });
381
 
382
  try {
383
  const page = await browser.newPage();
384
  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;]");
385
 
386
- await page.goto(url.replace("xnxx.com", "xnxxvideodownload.com"), { waitUntil: 'networkidle0' });
 
 
 
 
 
 
 
 
387
 
388
  const data = await page.evaluate(() => {
389
  const title = document.querySelector("body > main > section.e.j.d2.dsection > h2")?.textContent || '';
 
376
  async function XnDl(url) {
377
  const browser = await puppeteer.launch({
378
  headless: true,
379
+ args: ['--no-sandbox', '--disable-setuid-sandbox'],
380
+ timeout: 60000 // Timeout untuk peluncuran browser
381
  });
382
 
383
  try {
384
  const page = await browser.newPage();
385
  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;]");
386
 
387
+ await page.goto(url.replace("xnxx.com", "xnxxvideodownload.com"), {
388
+ waitUntil: 'domcontentloaded',
389
+ timeout: 60000 // Timeout untuk navigasi
390
+ });
391
+
392
+ await page.waitForNavigation({
393
+ waitUntil: 'networkidle0',
394
+ timeout: 60000 // Timeout untuk menunggu navigasi selesai
395
+ });
396
 
397
  const data = await page.evaluate(() => {
398
  const title = document.querySelector("body > main > section.e.j.d2.dsection > h2")?.textContent || '';