EasyXploit / HelpBot

A Discord bot designed for automated community moderation, leveling, chat utilities and much more!
MIT License
7 stars 1 forks source link

Tracks detected as playlists not playing #87

Closed EasyXploit closed 1 year ago

EasyXploit commented 2 years ago

Describe the bug When playing some YouTube songs, they are detected as playlists and not as songs by the "fetchResource" function, which is unable to correctly process the URL to obtain its metadata, causing an error that causes the program to abort the process of adding a item to the playback queue.

To Reproduce Steps to reproduce the behavior:

  1. Run the command: /play https://www.youtube.com/watch?v=kcYS_cUwr-8&list=PLKfyHF7f1VDulaHOdGiu4q5d6ObenhrjU&index=37.
  2. See the error on the console.

Expected behavior It should be detected and processed as a single track and added to the queue.

Error trace

8/31/2022, 12:56:35 PM 》ERROR: TypeError: Cannot read properties of undefined (reading 'playlist')
    at getWatchPlaylist (/***/***/HelpBot/node_modules/play-dl/dist/index.js:7:1030)
    at Object.playlist_info (/***/***/HelpBot/node_modules/play-dl/dist/index.js:6:60)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async exports.run (/***/***/HelpBot/functions/reproduction/parsePlaylist.js:8:26)
    at async exports.run (/***/***/HelpBot/functions/reproduction/fetchResource.js:116:21)
    at async exports.run (/***/***/HelpBot/handlers/commands/chatCommands/play/play.js:70:33)
EasyXploit commented 2 years ago

An error has started appearing on the console related to using a similar parameter (another playlist with a different URL format):

Arguments:

[{"name":"búsqueda","type":"STRING","value":"https://youtu.be/BmIyfjO0abE?list=RDBmIyfjO0abE"}]

Error trace:

TypeError: Cannot read properties of undefined (reading 'tabs')
    at getNormalPlaylist (/***/***/HelpBot/node_modules/play-dl/dist/index.js:6:70)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async exports.run (/***/***/HelpBot/functions/reproduction/parsePlaylist.js:8:26)
    at async exports.run (/***/***/HelpBot/functions/reproduction/fetchResource.js:116:21)
    at async exports.run (/***/***/HelpBot/handlers/commands/chatCommands/play/play.js:70:33)
EasyXploit commented 2 years ago

By updating the dependency play-dl to version 1.9.6, the error associated with this issue has been updated in the console, and is now displayed as follows:

Error: Watch playlist unavailable due to YouTube layout changes.
    at getWatchPlaylist (/home/dperales555/HelpBot/node_modules/play-dl/dist/index.js:7:1052)
    at Object.playlist_info (/home/dperales555/HelpBot/node_modules/play-dl/dist/index.js:6:60)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async exports.run (/home/dperales555/HelpBot/functions/reproduction/parsePlaylist.js:8:26)
    at async exports.run (/home/dperales555/HelpBot/functions/reproduction/fetchResource.js:116:21)
    at async exports.run (/home/dperales555/HelpBot/handlers/commands/chatCommands/play/play.js:70:33)

Which means that this error only occurs with YouTube auto-generated playlists, and not user-generated ones, as far as I can tell.

EasyXploit commented 2 years ago

@AtariTom is developing a solution for this. This issue will remain on standby until this occurs.

EasyXploit commented 1 year ago

Dropped, due to changes in https://github.com/EasyXploit/HelpBot/pull/125.