ilhamdev commited on
Commit
5604b18
·
verified ·
1 Parent(s): d746526

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +4 -1
index.js CHANGED
@@ -5,7 +5,10 @@ const ytdl = require('ytdl-core');
5
  const { Writable, pipeline } = require('stream');
6
  const util = require('util');
7
  const axios = require('axios');
8
- const fetch = require('node-fetch')
 
 
 
9
 
10
  // Regex untuk mengidentifikasi URL YouTube dan Mega
11
  const ytIdRegex = /(?:http(?:s|):\/\/|)(?:(?:www\.|)?youtube(?:\-nocookie|)\.com\/(?:shorts\/)?(?:watch\?.*(?:|\&)v=|embed\/|v\/)?|youtu\.be\/)([-_0-9A-Za-z]{11})/;
 
5
  const { Writable, pipeline } = require('stream');
6
  const util = require('util');
7
  const axios = require('axios');
8
+ let fetch;
9
+ (async () => {
10
+ fetch = (await import('node-fetch')).default;
11
+ })();
12
 
13
  // Regex untuk mengidentifikasi URL YouTube dan Mega
14
  const ytIdRegex = /(?:http(?:s|):\/\/|)(?:(?:www\.|)?youtube(?:\-nocookie|)\.com\/(?:shorts\/)?(?:watch\?.*(?:|\&)v=|embed\/|v\/)?|youtu\.be\/)([-_0-9A-Za-z]{11})/;