youtube-dl downloader plugin for webpack
A simple Node.js youtube-dl wrapper for webpack
This repository is a port version of youtube-dl-exec for webpack
Why
- Executes any command in an efficient way.
- Use
youtube-dl
in webpack
Installation
npm install --save youtube-dl-webpack
npm install --save-dev youtube-dl-downloader-webpack-plugin
Usage
In webpack build config
const { YoutudeDlDownloaderWebpackPlugin } = require('youtube-dl-downloader-webpack-plugin')
module.exports = {
...
plugins: [
new YoutudeDlDownloaderWebpackPlugin({
to: 'lib', // A directory to save file
from: 'auto', // A site to download file (auto, github or website)
})
...
]
}
see youtube-dl-downloader-webpack-plugin to know detail.
Use youtubedl in your codes
const youtubedl = require('youtube-dl-webpack')
youtubedl('https://example.com', {
dumpSingleJson: true,
noWarnings: true,
noCallHome: true,
noCheckCertificate: true,
preferFreeFormats: true,
youtubeSkipDashManifest: true,
referer: 'https://example.com',
}).then(output => console.log(output))
It's equivalent to:
$ youtube-dl https://example.com --dump-single-json --no-warnings --no-call-home --no-check-certificate --prefer-free-formats --youtube-skip-dash-manifest --referer=https://example.com
Contribution
We welcome your contribution in any way.