metascraper-media-provider

Get video property from HTML markup

Usage no npm install needed!

<script type="module">
  import metascraperMediaProvider from 'https://cdn.skypack.dev/metascraper-media-provider';
</script>

README

metascraper-media-provider

npm Dependency Status

Get specific video provider url (Facebook/Twitter/Vimeo/etc).

Install

$ npm install metascraper-media-provider --save

API

metascraper-media-provider([options])

options

cacheDir

Type: string

It specifies cache based on file system to be used by youtube-dl.

onError

Type: function

A function to be called when something wrong happens.

It will receive error and url.

const onError = (url, error) => {
  console.error(`${url} failed: ${error.message}`)
}
getProxy

Type: function

It will be called to determinate if a proxy should be used for resolving the next request URL.

const getProxy = ({ url, retryCount }) => {
  if (retryCount === 0) return false
  return 'http://user:pwd@proxy:8001'
}
retry

Type: number
Default: 5

The maximum number of retries allowed to perform.

timeout

Type: number
Default: 30000

The maximum time allowed to wait until considering the request as timed out.

userAgent

Type: string

It specifies a custom user agent.

License

metascraper-media-provider © Microlink, Released under the MIT License.
Authored and maintained by Microlink with help from contributors.

microlink.io · GitHub @microlink.io · Twitter @microlinkhq