getvideo

Get the url of the first video on a given page.

Usage no npm install needed!

<script type="module">
  import getvideo from 'https://cdn.skypack.dev/getvideo';
</script>

README

getVideo

This package permits you to get the url of the first video on a given page, getVideo will use a headless browser if necessary. Here is an example:

var getVideo = require("getvideo");
getVideo("https://youtube.com/watch?v=dQw4w9WgXcQ", (err, video) => {
    if(err){
        console.log(err);
    }
    else{
        console.log(video)
    }
});

If you want to use getVideo without a graphical environment, you'll need to run node through xvfb-run.