youtube-dl

CLI to download videos from YouTube.com and other video sites

youtubeDl.js
const mql = require('@microlink/mql')

const code = async ({ url, html }) => {
  const youtubedl = require('youtube-dl-exec')

  return youtubedl(url, {
    dumpSingleJson: true,
    noCheckCertificates: true,
    noWarnings: true,
    preferFreeFormats: true
  })
}

const youtubeDl = (url, props) =>
  mql(url, { function: code.toString(), meta: false, ...props }).then(
    ({ data }) => data.function
  )

const result = await youtubeDl(
  'https://imrane.substack.com/p/la-guerre-de-troie-pour-ecrire-un'
)

mql.render(result)