Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const request = require('request')
const hms = require('hh-mm-ss')
const http = require('http')
const url = require('url')
const {
isYouTubeRegex,
isWin,
formatDuration,
has,
isString
} = require('./util')
let ytdlBinary = require('./get-binary')()
const execa = universalify.fromPromise(require('execa'))
function youtubeDl (args, options, cb) {
return execa(ytdlBinary, args, options, function done (err, { stdout }) {
if (err) return cb(err)
return cb(null, stdout.trim().split(/\r?\n/))
})
}
/**
* Processes data
*
* @param {Object} data
* @param {Object} options
* @param {Object} stream
*/
'use strict'
const u = require('universalify').fromPromise
const fs = require('../fs')
function pathExists (path) {
return fs.access(path).then(() => true).catch(() => false)
}
module.exports = {
pathExists: u(pathExists),
pathExistsSync: fs.existsSync
}