twlite / discord-ytdl-core

Simple ytdl wrapper for discord bots with custom ffmpeg args support.
https://www.npmjs.com/package/discord-ytdl-core
Apache License 2.0
51 stars 10 forks source link

Errows thrown by ytdl aren't bubbling up #12

Closed MikeDev96 closed 3 years ago

MikeDev96 commented 3 years ago

ytdl-core currently has a JSON parse issue, which when triggered crashes the app with no way of capturing it. This isn't an issue when using ytdl-core directly.

Reproduce: Add an .on("error") event to the discord-ytdl-core stream. Modify ytdl-core's lib/info.js file and add the following on line 63: throw new Error("Test") Now run, ytdl-core should throw an error and you will see it's not captured by discord-ytdl-core.

MikeDev96 commented 3 years ago

Version bump to fix said JSON issue would be great too :) https://github.com/fent/node-ytdl-core/releases/tag/v3.4.1

twlite commented 3 years ago

I've added ytdl event forwarding, cheers 🍻

Events:

["info", "progress", "abort", "request", "response", "error", "redirect", "retry", "reconnect"]