aelia icon indicating copy to clipboard operation
aelia copied to clipboard

Feat(Music): Add autoplay

Open kyranet opened this issue 6 years ago • 3 comments

kyranet avatar Oct 12 '19 04:10 kyranet

What does this mean exactly? Considering that it starts playing automatically when you add a song.

Is this issue still needed?

favna avatar Jul 14 '20 23:07 favna

When autoplay is on and the queue finishes, Skyra plays songs related to the last one, similarly to how YouTube's "Play Next" works.

It was a feature in Skyra until we moved to Lavalink, ytdl-core gives us the related videos and a ton more of metadata, but Lavalink doesn't share that much information.

kyranet avatar Jul 15 '20 05:07 kyranet

Hey there @kyranet , here is how you can implement autoplay system.

  1. When the track ends you need the information of the track that ends. With that information you get the identifier (ID) of the song

2.Then you will create a mix from YouTube, with this link https://www.youtube.com/watch?v=${identifier}&list=RD${identifier};

  1. Search it using the lavalink library and add the second song from the mix to the queue. Because the first song would be the same one which you played before

  2. When the song ends you will have repeat the steps again.

Example: Song link : https://www.youtube.com/watch?v=Xgs99T6CKPg Identifier: Xgs99T6CKPg Mix Link: https://www.youtube.com/watch?v=Xgs99T6CKPg&list=RDXgs99T6CKPg Result: image

anishshobithps avatar Dec 12 '20 13:12 anishshobithps