discord-player-youtubei 2.0.0-dev → 2.0.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -296,7 +296,12 @@ async function generateStreamWithYoutubeDL(track, youtubei) {
296
296
  if (youtubei.options.logLevel === "ALL") console.log(e);
297
297
  });
298
298
  const stream = process2.stdout;
299
- return stream ? stream : void 0;
299
+ if (!stream) return void 0;
300
+ const killProcess = () => process2.killed && process2.kill();
301
+ stream.on("close", killProcess);
302
+ stream.on("error", killProcess);
303
+ stream.on("end", killProcess);
304
+ return stream;
300
305
  }
301
306
 
302
307
  // lib/Extractor/Youtube.ts
package/dist/index.mjs CHANGED
@@ -264,7 +264,12 @@ async function generateStreamWithYoutubeDL(track, youtubei) {
264
264
  if (youtubei.options.logLevel === "ALL") console.log(e);
265
265
  });
266
266
  const stream = process2.stdout;
267
- return stream ? stream : void 0;
267
+ if (!stream) return void 0;
268
+ const killProcess = () => process2.killed && process2.kill();
269
+ stream.on("close", killProcess);
270
+ stream.on("error", killProcess);
271
+ stream.on("end", killProcess);
272
+ return stream;
268
273
  }
269
274
 
270
275
  // lib/Extractor/Youtube.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "discord-player-youtubei",
3
- "version": "2.0.0-dev",
3
+ "version": "2.0.0-dev.1",
4
4
  "description": "An unofficial package to test the use of youtubei in discord-player v6.",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -25,7 +25,7 @@
25
25
  "jsdom": "^26.1.0",
26
26
  "tiny-typed-emitter": "^2.1.0",
27
27
  "undici": "^7.1.0",
28
- "youtube-dl-exec": "^3.0.30",
28
+ "youtube-dl-exec": "^3.1.3",
29
29
  "youtubei.js": "^16.0.1"
30
30
  },
31
31
  "scripts": {