irbyk / Plex-Discord-Bot_V2

Upgrade of the Plex-Discord-Bot by danxfisher : https://github.com/danxfisher/Plex-Discord-Bot
BSD 3-Clause "New" or "Revised" License
57 stars 12 forks source link

Can't play YouTube anymore. #19

Closed Tsumitsuki closed 3 years ago

Tsumitsuki commented 3 years ago

As the title says the bot refuses to play youtube links.

The log: `logged in as: Rogue#6830 name: PlexBone v: 1.23.2.4656-85f0adf5b bot version: 2.2.8

WARNING: ytdl-core is out of date! Update with "npm install ytdl-core@latest". WARNING: ytdl-core is out of date! Update with "npm install ytdl-core@latest". WARNING: ytdl-core is out of date! Update with "npm install ytdl-core@latest". (node:8) UnhandledPromiseRejectionWarning: Error: Status code: 404

at ClientRequest. (/home/PlexBot/node_modules/miniget/dist/index.js:211:27) at Object.onceWrapper (events.js:422:26) at ClientRequest.emit (events.js:315:20) at HTTPParser.parserOnIncomingClient (_http_client.js:641:27) at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17) at TLSSocket.socketOnData (_http_client.js:509:22) at TLSSocket.emit (events.js:315:20) at addChunk (internal/streams/readable.js:309:12) at readableAddChunk (internal/streams/readable.js:284:9) at TLSSocket.Readable.push (internal/streams/readable.js:223:10) (Use node --trace-warnings ... to show where the warning was created)

(node:8) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

(node:8) [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. (node:8) UnhandledPromiseRejectionWarning: Error: Status code: 404`

As the log mentioned i updated te ytdl core but still nothing:

`logged in as: Rogue#6830 name: PlexBone v: 1.23.2.4656-85f0adf5b bot version: 2.2.8

(node:8) UnhandledPromiseRejectionWarning: Error: Status code: 404

at ClientRequest. (/home/PlexBot/node_modules/miniget/dist/index.js:210:27) at Object.onceWrapper (events.js:422:26) at ClientRequest.emit (events.js:315:20) at HTTPParser.parserOnIncomingClient (_http_client.js:641:27) at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17) at TLSSocket.socketOnData (_http_client.js:509:22) at TLSSocket.emit (events.js:315:20) at addChunk (internal/streams/readable.js:309:12) at readableAddChunk (internal/streams/readable.js:284:9) at TLSSocket.Readable.push (internal/streams/readable.js:223:10) (Use node --trace-warnings ... to show where the warning was created)

(node:8) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

(node:8) [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.`

irbyk commented 3 years ago

This is because youtube has just updated its API and ytdl-core needs to be updated too. More information here. As soon as they release an update I'll update the bot.

Edit : wrong link.

Tsumitsuki commented 3 years ago

ye. i thought that since some other tools i use broke too. after an update everything was fine again. i hoped that the mentioned core update of ytdl alrady were that update, but seems not to.

however. thanks for keep working on the bot!^^

JuanTaco4You commented 3 years ago

same issue here im about to try this fix and ill report back to see if it works again

https://github.com/fent/node-ytdl-core/commit/d1f535712410eebd79a7468abd07d94f8c4ebe5a

JuanTaco4You commented 3 years ago

ok so heres an update after doing some digging google changed their api. some people are having success on 4.8.3 this is running 4.5 this probably is going to need updated. hope this helps dev. }, "ytdl-core": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/ytdl-core/-/ytdl-core-4.5.0.tgz", "integrity": "sha512-e8r6skrakWNixsVlNPBMoRM1HrdW1swE97If9nenDUjF65uogYk4DvxIuqlmqRfBWKe+6aIZwqedNxUU9XLYJA==", "requires": { "m3u8stream": "^0.8.3", "miniget": "^4.0.0", "sax": "^1.1.3" }

edit: https://github.com/fent/node-ytdl-core/commit/d1f535712410eebd79a7468abd07d94f8c4ebe5a

JuanTaco4You commented 3 years ago

OK LAST update for now, i was able to get it to work on my bot. this is how i fixed it. cd /node_modules/ytdl-core npm i git://github.com/fent/node-ytdl-core.git#d1f535712410eebd79a7468abd07d94f8c4ebe5a

irbyk commented 3 years ago

ytdl-core release a new version which fix the issue. I have updated the bot and you should just need to update it (I fix some minor issues too). You can also just do npm install ytdl-core@latest if you just want to fix the youtube command without updating the bot.

irbyk commented 3 years ago

OK LAST update for now, i was able to get it to work on my bot. this is how i fixed it. cd /node_modules/ytdl-core npm i git://github.com/fent/node-ytdl-core.git#d1f535712410eebd79a7468abd07d94f8c4ebe5a

Thanks for the research but I was waiting for a release from the ytdl team ^^. I don't want to use a non-npm package for this bot, so I didn't consider using this in the first place.

JuanTaco4You commented 3 years ago

OK LAST update for now, i was able to get it to work on my bot. this is how i fixed it. cd /node_modules/ytdl-core npm i git://github.com/fent/node-ytdl-core.git#d1f535712410eebd79a7468abd07d94f8c4ebe5a

Thanks for the research but I was waiting for a release from the ytdl team ^^. I don't want to use a non-npm package for this bot, so I didn't consider using this in the first place.

This was a 404 error... its only a link that the google api needed to use. Not really needed for a whole update. But since we were on 4.5 not 4.8.3 i see the need to wait for an official update on the that upgrade but thats been out for while.

irbyk commented 3 years ago

The 4.8.2 didn't fix this issue, and 4.8.3 was released 18h ago.