{"version":3,"sources":["jsdelivr-header.js","/npm/@alpacamybags118/yt-dlp-exec@0.1.1/src/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aACA,MAAM,MAAQ,QAAQ,SAChB,MAAQ,QAAQ,SAChB,KAAO,QAAQ,SACf,cAAE,eAAkB,QAAQ,aAG5B,aAAe,KAAK,KAAK,KAAK,KAAK,UAAU,UAAW,iBAQ9D,SAAS,uBAAuB,EAAU,GACxC,MAAO,CAAC,GAAU,OAAO,MAAM,EAAS,CAAC,WAAW,IACtD,CASA,SAAS,qBAAqB,EAAU,EAAS,EAAiB,CAAE,MAAO,CAAC,SAAU,OAAQ,YAC5F,IAAI,EACF,MAAM,IAAI,MAAM,oCAGlB,OAAO,MAAM,aAAc,uBAAuB,EAAU,GAAU,EACxE,CAEA,OAAO,QAAU,qBACjB,OAAO,QAAQ,qBAAqB,qBACpC,OAAO,QAAQ,uBAAyB","file":"/npm/@alpacamybags118/yt-dlp-exec@0.1.1/src/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@alpacamybags118/yt-dlp-exec@0.1.1/src/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict'\nconst dargs = require('dargs');\nconst execa = require('execa');\nconst path = require('path');\nconst { getBinaryName } = require('./helpers');\n\n\nconst pathToBinary = path.join(path.join(__dirname,'../bin'), getBinaryName())\n\n/**\n * Takes media URL and options for invoking yt-dlp and formats them in a string array.\n * @param {string} mediaUrl The URL of the media you wish to download with ytp\n * @param {*} options An object that represents the command line options to invoke yt-dlp with. Uses dargs (https://github.com/sindresorhus/dargs) for object format. See https://github.com/yt-dlp/yt-dlp#usage-and-options for all options\n * @returns string[]\n */\nfunction generateArgumentString(mediaUrl, options) {\n  return [mediaUrl].concat(dargs(options, {useEquals: false}))\n}\n\n/**\n * createYtDlpAsProcess will create a child process that invokes yt-dlp with the provided arguments and return that process.\n * @param {string} mediaUrl The URL of the media you wish to download with ytp\n * @param {*} options An object that represents the command line options to invoke yt-dlp with. Uses dargs (https://github.com/sindresorhus/dargs) for object format. See https://github.com/yt-dlp/yt-dlp#usage-and-options for all options.\n * @param {*} processOptions (Optional) An object that represents the exposed options when creating a process with `execa`. Defaults to `{ stdio: ['ignore', 'pipe', 'ignore'] }`. See https://github.com/sindresorhus/execa#options for all options.\n * @returns {execa.ExecaChildProcess} Process that executes yt-dlp\n */\nfunction createYtDlpAsProcess(mediaUrl, options, processOptions = { stdio: ['ignore', 'pipe', 'ignore'] }) {\n  if(!mediaUrl) {\n    throw new Error('Media URL has not been provided!');\n  }\n\n  return execa(pathToBinary, generateArgumentString(mediaUrl, options), processOptions);\n}\n\nmodule.exports = createYtDlpAsProcess\nmodule.exports.createYtDlpAsProcess=createYtDlpAsProcess;\nmodule.exports.generateArgumentString = generateArgumentString\n"]}