ytmusic_api_unofficial
Version:
A simple API to get music from YouTube Music
30 lines • 934 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Player_1 = __importDefault(require("./Player"));
class StreamPlayer {
constructor(data) {
this.audios = data.audios.map((item) => new Player_1.default(item));
this.videos = data.videos.map((item) => new Player_1.default(item));
this.available = data.available;
if (!this.available)
this.unplayable_reason = data.unplayable_reason;
this.maxBitrate = data.maxBitrate;
}
/**
* Get the best audio quality
*/
bestAudio() {
return this.audios[0];
}
/**
* Get the best video quality
*/
bestVideo() {
return this.videos[0];
}
}
exports.default = StreamPlayer;
//# sourceMappingURL=StreamPlayer.js.map