node-ytdl-core: Error parsing config: Unexpected token ; in JSON at position

LogFile

Error: Error parsing config: Unexpected token ; in JSON at position 67262
    at gotConfig (C:\Users\theild\Desktop\Repo\uwuBot\node_modules\ytdl-core\lib\info.js:123:21)
    at C:\Users\theild\Desktop\Repo\uwuBot\node_modules\ytdl-core\lib\info.js:74:7
    at PassThrough.<anonymous> (C:\Users\theild\Desktop\Repo\uwuBot\node_modules\miniget\dist\index.js:196:32)
    at PassThrough.emit (events.js:223:5)
    at endReadableNT (_stream_readable.js:1185:12)
    at processTicksAndRejections (internal/process/task_queues.js:81:21)

Console

(node:2456) UnhandledPromiseRejectionWarning: Error [ERR_UNHANDLED_ERROR]: Unhandled error. ('No stream')
    at StreamDispatcher.emit (events.js:212:17)
    at StreamDispatcher.startStreaming (C:\Users\theild\Desktop\Repo\uwuBot\node_modules\discord.js\src\client\voice\dispatcher\StreamDispatcher.js:310:12)
    at new StreamDispatcher (C:\Users\theild\Desktop\Repo\uwuBot\node_modules\discord.js\src\client\voice\dispatcher\StreamDispatcher.js:34:56)
    at AudioPlayer.createDispatcher (C:\Users\theild\Desktop\Repo\uwuBot\node_modules\discord.js\src\client\voice\player\AudioPlayer.js:162:24)
    at AudioPlayer.playOpusStream (C:\Users\theild\Desktop\Repo\uwuBot\node_modules\discord.js\src\client\voice\player\AudioPlayer.js:137:29)
    at VoiceConnection.playOpusStream (C:\Users\theild\Desktop\Repo\uwuBot\node_modules\discord.js\src\client\voice\VoiceConnection.js:567:24)
    at playyt (C:\Users\theild\Desktop\Repo\uwuBot\Commands\Music.js:177:23)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:94:5)
(node:2456) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2456) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
events.js:200
      throw er; // Unhandled 'error' event
      ^

Error: Status code: 416
    at ClientRequest.<anonymous> (C:\Users\theild\Desktop\Repo\uwuBot\node_modules\miniget\dist\index.js:128:27)
    at Object.onceWrapper (events.js:313:26)
    at ClientRequest.emit (events.js:223:5)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:592:27)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:116:17)
    at HTTPParser.execute (<anonymous>)
    at TLSSocket.socketOnData (_http_client.js:465:22)
    at TLSSocket.emit (events.js:223:5)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:290:11)
    at TLSSocket.Readable.push (_stream_readable.js:224:10)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:181:23)
Emitted 'error' event on PassThrough instance at:
    at PassThrough.<anonymous> (C:\Users\theild\Desktop\Repo\uwuBot\node_modules\ytdl-core\lib\index.js:133:14)
    at PassThrough.emit (events.js:223:5)
    at ClientRequest.<anonymous> (C:\Users\theild\Desktop\Repo\uwuBot\node_modules\miniget\dist\index.js:133:28)
    at Object.onceWrapper (events.js:313:26)
    [... lines matching original stack trace ...]
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:181:23)

My DiscordBot crashed unexpected after stopping an opusstream and leaving the channel. Playing the same Stream after starting the bot again worked fine with different songs. ‘https://www.youtube.com/watch?v=iGHnrIn6Ssw’ always stops at ~0:55 and the stream end event happens a few seconds after. I was not able to recreate the Full Crash but its still weird that this single song doesnt work

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 25 (10 by maintainers)

Commits related to this issue

Most upvoted comments

the latest version is 2.1.5, update with npm i ytdl-core@latest

if it still doesn’t install the latest version, read further steps to take at the bottom of the readme