Splamy / TS3AudioBot

Advanced Musicbot for Teamspeak 3
https://splamy.de/TSAudioBot/Home
Open Software License 3.0
678 stars 138 forks source link

Playing local playlists .m3u8, .m3u, .cue #873

Open mekket opened 3 years ago

mekket commented 3 years ago

Since yt-dl is not working properly - It would be great if it was possible to play local music from a premade playlist file. For example I have CDs and mixes with split songs but they include a playlist file(.m3u8, .m3u, .cue) that would turn the split mix into a continuous mix. Right now, if i try to start these playlist files, it does not work.

I know that I could manually add every single song but this would take forever if I wanted to play a lot of music and keep adding new stuff.

Flakebi commented 3 years ago

Playlists are supported though the !list … commands: https://github.com/Splamy/TS3AudioBot/wiki/Playlists I think you should be able to do !list import mylist /path/to/list.m3u and !list play mylist.

mekket commented 3 years ago

I am aware of the list commands and I use them daily, however I was not able to get it to work: I am getting the following result: Error: Could not load. (media: An unknown error occoured.)

If I could get this to work - it would be a kind of a workaround to my problem but still I think it would be a great improvement if it was possible to straight out just play the existing list instead of importing a list every time I or someone else wants to play something new.

And now that I think about it - It would be even better if i could feed the bot a directory which contains music files/playlists/mp3s and the bot would then see which files it recognizes and plays them straight out of the folder.

Flakebi commented 3 years ago

Can you paste the relevant part from the log file please? There should probably be an exception there (note that the log file contains stacktraces while the console output does not).

I agree that using !play <playlist> would be nice.

I’m not sure but it might already be possible to use a folder as a playlist.

mekket commented 3 years ago

2020-11-03 16:22:03.0870| INFO|0|Bot.OnMessageReceived User ŠæŠµŠæŠ° Š±ŠøŠ³ requested: !list import asot "/opt/teamspeak/teamspeak3-server_linux_amd64/files/virtualserver_1/channel_1/Muusika/Armin Van Buuren - A State Of Trance 488 (2010-12-23) (Inspiron)/[Armin van Buuren] A State of Trance Episode 488 (2010-12-23) (ASOT Top 20 of 2010).m3u" 2020-11-03 16:22:03.0892| WARN|0|MediaResolver.GetPlaylist Error opening/reading playlist file System.IO.DirectoryNotFoundException: Could not find a part of the path '/opt/teamspeak/teamspeak3-server_linux_amd64/files/virtualserver_1/channel_1/Muusika/Armin%20Van%20Buuren%20-%20A%20State%20Of%20Trance%20488%20(2010-12-23)%20(Inspiron)/[Armin%20van%20Buuren]%20A%20State%20of%20Trance%20Episode%20488%20(2010-12-23)%20(ASOT%20Top%2020%20of%202010).m3u'. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at TS3AudioBot.ResourceFactories.MediaResolver.GetPlaylist(ResolveContext ctx, String url) in C:\projects\ts3audiobot\TS3AudioBot\ResourceFactories\MediaResolver.cs:line 210

Is this what i was supposed to paste?

I tried multiple playlists and they all give the same result. I have also tried to use !play (folder path) but that does not work for me either. Maybe I am not giving the correct command?

Flakebi commented 3 years ago

Yes thanks, that’s the correct part. So it complains that it can’t find a part of the path /opt/teamspeak/teamspeak3-server_linux_amd64/files/virtualserver_1/channel_1/Muusika/Armin%20Van%20Buuren%20-%20A%20State%20Of%20Trance%20488%20(2010-12-23)%20(Inspiron)/[Armin%20van%20Buuren]%20A%20State%20of%20Trance%20Episode%20488%20(2010-12-23)%20(ASOT%20Top%2020%20of%202010).m3u. Does this file exist there?

!list import mylist /path/to/folder may work?

mekket commented 3 years ago

Yes i am sure that the file is there. "!list import mylist /path/to/folder" Did work and the bot even sees the playlist files but if i play this newly imported list it just skips over those. It starts playing the mp3 files. Sadly the tracklist/queue is incorrect. For example the list i just imported was originally a continuous mix which has been split into parts and it is supposed to be played in a certain order. Probably the same with some albums. But still this is already making things easier for me.

mekket commented 3 years ago

Also if i try your method of adding local music, it only works if you feed it a direct folder which contains music and does not see inside subfolders. In my opinion it would also be a nice enhancement if the bot could search for music inside subfolders. For example: Artist folder - multiple album folders - mp3s. I would like to give the bot the artist folder and have it pick out all of the mp3s.