jwplayer-scraper

1.2.0 • Public • Published

jwplayer-scraper

This module helps you get the source URLs of the media that is added to the JW Player in the page/iframes using node.js

Installation

This module can be installed via npm:

$ npm install --save jwplayer-scraper

Usage

var scraper = require("jwplayer-scraper");

Functions

scraper.getMediaSources(URL, options)

  • URL: URL of the page that needs to be scraped
  • options (optional): For now, this can only contain an object with the 'jwplayerFilename' key. If it's not set, it will try to automatically locate the jwplayer.js file. (This is experimental)
var scraper = require("jwplayer-scraper");
 
(async function() {
  var sources = await scraper.getMediaSources(
    "https://<URL_OF_THE_WEBSITE>/<PATH_TO_THE_PAGE>",
    {
      jwplayerFilename: "jwplayer.6.11.js"
    }
  );
 
  console.log(sources);
})();

or if you want to use it with .then() instead of async/await:

var scraper = require("jwplayer-scraper");
 
scraper
  .getMediaSources("https://<URL_OF_THE_WEBSITE>/<PATH_TO_THE_PAGE>")
  .then(sources => {
    console.log(sources);
  });

Readme

Keywords

Package Sidebar

Install

npm i jwplayer-scraper

Weekly Downloads

19

Version

1.2.0

License

MIT

Unpacked Size

7.43 kB

Total Files

5

Last publish

Collaborators

  • furkaninanc