Microlink × YouTube

Interact with
youtube.com

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

const youtube = async (url, opts) => {
  const result = await mql(url, {
    prerender: true,
    video: true,
    audio: true,
    data: {
      views: {
        selector: '.view-count',
        type: 'number'
      }
    },
    ...opts
  })

  return result
}

const result = await youtube('https://www.youtube.com/watch?v=dQw4w9WgXcQ')

mql.render(result)