Hazmi35 / jukebox

Just a simple Discord music bot.
GNU Affero General Public License v3.0
72 stars 35 forks source link

Play command issue on Jukebox 4.X #661

Closed KTSnowy closed 3 years ago

KTSnowy commented 3 years ago

When using the play command to search for a song ("Jukebox play lofi" for example), some searches return:

[error]: TypeError: Cannot read property 'split' of null

Which seems to come from the durationToMS(duration) function in the Video.ts file:

const args = duration.split(":");

KTSnowy commented 3 years ago

Can't seem to find what's causing this, since the video duration doesn't seem to show up on the search results embed and it doesn't happen with every input.

Commenting out everything related to duration in the Video.ts file seems to fix this

Hazmi35 commented 3 years ago

Ah, my bad. Duration is actually planned to be released in v4 but was postponed to v5, and I don't double-check the durationToMS function.

This happens because the durationToMS function fails to parse YouTube live videos, and the ytsr module is reporting null because live videos don't have live duration yet, unlike YouTubeAPI.

This also doesn't happen on v5 because there is no code for parsing duration yet

This issue is fixed in #662

Hazmi35 commented 3 years ago

Fixed in Version 4.42.6