This repository has been archived on 2026-01-13. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Lunaris/music_sources/soundcloud.js
2023-06-28 03:04:01 +02:00

14 lines
387 B
JavaScript

const playdl = require('play-dl');
async function getStream(query) {
const songInformation = await playdl.soundcloud(query);
const stream = await playdl.stream_from_info(songInformation, { quality: 2 });
return {
title: songInformation.name,
stream: stream.stream,
duration: songInformation.durationInSec * 1000,
userInput: query,
};
}
module.exports.getStream = getStream;