youtube-dl-node
Version:
youtube-dl wrapper for node.js
47 lines (36 loc) • 1.73 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _path = require('path');
var _path2 = _interopRequireDefault(_path);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Base = function () {
function Base(props) {
_classCallCheck(this, Base);
this._saveToPath = '.';
this._ytdlFileName = 'youtube-dl';
this._versionFileName = 'VERSION';
}
_createClass(Base, [{
key: 'setPath',
value: function setPath(userPath) {
this._saveToPath = _path2.default.normalize(userPath);
}
}, {
key: '_getVersionFilePath',
value: function _getVersionFilePath() {
return _path2.default.join(this._saveToPath, this._versionFileName);
}
}, {
key: '_getYtdlBinaryPath',
value: function _getYtdlBinaryPath() {
return _path2.default.join(this._saveToPath, this._ytdlFileName);
}
}]);
return Base;
}();
exports.default = Base;
module.exports = exports['default'];
;