youtube-dl

Get metadata for any video URL. Over 700 online video services supported.

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)