{"action":"created","issue":{"url":"https://api.github.com/repos/fent/node-ytdl-core/issues/73","repository_url":"https://api.github.com/repos/fent/node-ytdl-core","labels_url":"https://api.github.com/repos/fent/node-ytdl-core/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/fent/node-ytdl-core/issues/73/comments","events_url":"https://api.github.com/repos/fent/node-ytdl-core/issues/73/events","html_url":"https://github.com/fent/node-ytdl-core/issues/73","id":153633898,"number":73,"title":"Error caused when end stream early","user":{"login":"SquirrelsMcGee","id":8070535,"avatar_url":"https://avatars.githubusercontent.com/u/8070535?v=3","gravatar_id":"","url":"https://api.github.com/users/SquirrelsMcGee","html_url":"https://github.com/SquirrelsMcGee","followers_url":"https://api.github.com/users/SquirrelsMcGee/followers","following_url":"https://api.github.com/users/SquirrelsMcGee/following{/other_user}","gists_url":"https://api.github.com/users/SquirrelsMcGee/gists{/gist_id}","starred_url":"https://api.github.com/users/SquirrelsMcGee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SquirrelsMcGee/subscriptions","organizations_url":"https://api.github.com/users/SquirrelsMcGee/orgs","repos_url":"https://api.github.com/users/SquirrelsMcGee/repos","events_url":"https://api.github.com/users/SquirrelsMcGee/events{/privacy}","received_events_url":"https://api.github.com/users/SquirrelsMcGee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-05-08T03:51:50Z","updated_at":"2016-05-10T17:57:57Z","closed_at":null,"body":"I am attempting to write a bot for a Discord server that I am an admin for, this bot needs to have youtube playback in the voice channels.\r\n\r\nThe following error is caused when trying to end a stream early, i.e. when someone calls the function to play a video while a video is already being played.\r\n\r\n`Error: write after end\r\n    at writeAfterEnd (_stream_writable.js:166:12)\r\n    at PassThrough.Writable.write (_stream_writable.js:217:5)\r\n    at IncomingMessage.ondata (_stream_readable.js:555:20)\r\n    at emitOne (events.js:96:13)\r\n    at IncomingMessage.emit (events.js:188:7)\r\n    at IncomingMessage.Readable.read (_stream_readable.js:387:10)\r\n    at flow (_stream_readable.js:764:26)\r\n    at resume_ (_stream_readable.js:744:3)\r\n    at _combinedTickCallback (internal/process/next_tick.js:74:11)\r\n    at process._tickCallback (internal/process/next_tick.js:98:9)`\r\n\r\nI've searched around and read some of the docs and discovered that none of the methods for ending a stream early work, at least for me.\r\ni've tested: \r\n`stream.destroy` (stream#destroy did not work at all, crashing the bot entirely)\r\n`stream.end`\r\n`stream.abort`\r\n\r\nthese seem to produce errors saying that they cannot read *blank* of undefined\r\n\r\npls forgive any spelling mistakes as it is like, 5 in the morning right now and im fed up trying to get this to work frankly\r\n"},"comment":{"url":"https://api.github.com/repos/fent/node-ytdl-core/issues/comments/218238823","html_url":"https://github.com/fent/node-ytdl-core/issues/73#issuecomment-218238823","issue_url":"https://api.github.com/repos/fent/node-ytdl-core/issues/73","id":218238823,"user":{"login":"Razzile","id":5256381,"avatar_url":"https://avatars.githubusercontent.com/u/5256381?v=3","gravatar_id":"","url":"https://api.github.com/users/Razzile","html_url":"https://github.com/Razzile","followers_url":"https://api.github.com/users/Razzile/followers","following_url":"https://api.github.com/users/Razzile/following{/other_user}","gists_url":"https://api.github.com/users/Razzile/gists{/gist_id}","starred_url":"https://api.github.com/users/Razzile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Razzile/subscriptions","organizations_url":"https://api.github.com/users/Razzile/orgs","repos_url":"https://api.github.com/users/Razzile/repos","events_url":"https://api.github.com/users/Razzile/events{/privacy}","received_events_url":"https://api.github.com/users/Razzile/received_events","type":"User","site_admin":false},"created_at":"2016-05-10T17:57:57Z","updated_at":"2016-05-10T17:57:57Z","body":"I also get this error."}}