Closed VenomSA closed 2 months ago
Change ytdl to the YtdlCore class. It can be used as a static method.
Is the problem resolved? If you continue to receive no reply, I will close this issue as resolved.
Ok I managed to do this and its working, and how to apply the audioonly filter for mp3 download now?
const ytdl = new YtdlCore({
agent: YtdlCore.createProxyAgent({ uri: getRandomProxyAgent() }),
});
Before I had something like this
const audioStream = ytdl(videoURL, { filter: "audioonly" });
const chunks = [];
audioStream.on("data", (chunk) => {
chunks.push(chunk);
});
audioStream.on("end", () => {
const buffer = Buffer.concat(chunks);
resolve({ base64: buffer.toString("base64"), title: videoTitle });
});
audioStream.on("error", (err) => {
reject(err);
});```
Thanks!
https://github.com/ybd-project/ytdl-core/tree/main/examples/Download Please refer to this.
Thank you! You can close it.
The issue has been resolved and the issue is closed.
I need an example on how to use proxies on this updated package.
This throws 'Can't access ytdl before initialisation' which is correct.
Also, would be nice to know how to turn videos to mp3, distube repo had the audioonly filter but for this package I couldn't find anything similar, so any help would be appreciated!
And sorry if I created an issue with the purpose of asking questions.