Closure-RI commited on
Commit
add436a
·
verified ·
1 Parent(s): cf6aa9c

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +1 -3
index.js CHANGED
@@ -1266,7 +1266,6 @@ async function scrapeHAnimeDetails(url) {
1266
  let video = null;
1267
 
1268
  if (iframeSrc) {
1269
- const newPage = await browser.newPage();
1270
  const responseA = await axios.get(`https://arashicode-api.hf.space/html?url=${iframeSrc}`);
1271
  // Ambil HTML dari halaman iframe
1272
  console.log("Iframe HTML:", responseA.data);
@@ -1284,8 +1283,6 @@ async function scrapeHAnimeDetails(url) {
1284
  console.log("Data-ID URL:", dataId);
1285
 
1286
  if (dataId) {
1287
- await newPage.goto(dataId, { waitUntil: "domcontentloaded" });
1288
- await browser.close();
1289
  await delay(17000); // Delay 8 detik untuk memastikan data tersedia
1290
 
1291
  const response = await axios.get(`https://arashicode-api.hf.space/html?url=${dataId}`);
@@ -1307,6 +1304,7 @@ async function scrapeHAnimeDetails(url) {
1307
  result.video = video;
1308
 
1309
  // Tutup browser
 
1310
 
1311
  return result;
1312
  } catch (error) {
 
1266
  let video = null;
1267
 
1268
  if (iframeSrc) {
 
1269
  const responseA = await axios.get(`https://arashicode-api.hf.space/html?url=${iframeSrc}`);
1270
  // Ambil HTML dari halaman iframe
1271
  console.log("Iframe HTML:", responseA.data);
 
1283
  console.log("Data-ID URL:", dataId);
1284
 
1285
  if (dataId) {
 
 
1286
  await delay(17000); // Delay 8 detik untuk memastikan data tersedia
1287
 
1288
  const response = await axios.get(`https://arashicode-api.hf.space/html?url=${dataId}`);
 
1304
  result.video = video;
1305
 
1306
  // Tutup browser
1307
+ await browser.close();
1308
 
1309
  return result;
1310
  } catch (error) {