text: const axios = require('axios')
  const cheerio = require('cheerio')
  const qs = require('qs')
  
  let is = {
      headers: {
          'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
          "sec-ch-ua": '" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"',
          "cookie": "PHPSESSID=ugpgvu6fgc4592jh7ht9d18v49; _ga=GA1.2.1126798330.1625045680; _gid=GA1.2.1475525047.1625045680; __gads=ID=92b58ed9ed58d147-221917af11ca0021:T=1625045679:RT=1625045679:S=ALNI_MYnQToDW3kOUClBGEzULNjeyAqOtg",
          "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
      }
  }
  
  function _token(host) {
      return new Promise(async (resolve, reject) => {
          axios.request({
              url: host, method: 'GET', headers: {
                  "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
                  "cookie": "PHPSESSID=ugpgvu6fgc4592jh7ht9d18v49; _ga=GA1.2.1126798330.1625045680; _gid=GA1.2.1475525047.1625045680; __gads=ID=92b58ed9ed58d147-221917af11ca0021:T=1625045679:RT=1625045679:S=ALNI_MYnQToDW3kOUClBGEzULNjeyAqOtg"
              }
          }).then(({ data }) => {
              let $ = cheerio.load(data)
              let token = $('#token').attr('value')
              resolve(token)
          })
      })
  }
  
  function facebook(url) {
      return new Promise(async (resolve, reject) => {
          let host = 'https://aiovideodl.ml/'
          let form = { data: { 'url': url, 'token': (await _token(host)) } }
          axios.post(host + '/system/action.php', qs.stringify(form.data), { headers: is.headers })
              .then(({ data }) => {
                  if (data == 'error') return resolve({ creator: '@Made By Rey', status: false, message: 'tida dapat diunduh' })
                  resolve({ creator: '@Made by Rey', status: true, thumb: data.thumbnail, data: data.links })
              })
      })
  }
  
  module.exports = { facebook }