Splamy / TS3AudioBot

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

the bot is not playing music #913

Closed nektryn closed 3 years ago

nektryn commented 3 years ago

Describe the problem after the! play command, nothing plays, and in the queue after! info shows the song

To Reproduce Steps to reproduce the behavior

System Information

2021-04-15 10:11:02.0556| INFO|Core|Setup.LogHeader [============ TS3AudioBot started =============] 2021-04-15 10:11:02.1009| INFO|Core|Setup.LogHeader [ Date: Thursday, 15 April 2021 10:11:02 2021-04-15 10:11:02.2011| INFO|Core|Setup.LogHeader [ Version: 0.12.2/master/4c6be036 2021-04-15 10:11:02.2011| INFO|Core|Setup.LogHeader [ Build: Release 2021-04-15 10:11:02.2011| INFO|Core|Setup.LogHeader [ Platform: Windows 6.2.9200.0 (64bit) 2021-04-15 10:11:02.2011| INFO|Core|Setup.LogHeader [ Runtime: .NET Framework 3.1.13 ServerGC:True GC:SustainedLowLatency 2021-04-15 10:11:02.2011| INFO|Core|Setup.LogHeader [ Opus: libopus 1.2.1-fixed (x64) 2021-04-15 10:11:02.2011| INFO|Core|Setup.LogHeader [==============================================] 2021-04-15 10:11:02.8215| INFO|Core|WebServer.StartWebServerInternal Starting Webserver on port 58913 2021-04-15 10:11:03.0394| INFO|Core|Bot.Run Bot "default" connecting to "midov.pl" 2021-04-15 10:11:03.6678| INFO|Core|Ts3Client.ConnectClient Client connected. 2021-04-15 10:11:14.9462| INFO|0|Bot.OnMessageReceived User Nektryn requested: !play [URL]https://www.youtube.com/watch?v=1rTV7DCnF3Y[/URL] 2021-04-15 10:11:18.3667|ERROR|0|FfmpegProducer.StartFfmpegProcessInternal Ffmpeg could not be found (Nie można odnaleźć określonego pliku.) System.ComponentModel.Win32Exception (2): Nie można odnaleźć określonego pliku. at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at TS3AudioBot.Audio.FfmpegProducer.StartFfmpegProcessInternal(FfmpegInstance instance, String arguments) in C:\projects\ts3audiobot\TS3AudioBot\Audio\FfmpegProducer.cs:line 282 2021-04-15 10:11:18.4579| WARN|0|Util.UnwrapToLog permissions_client_insufficient: the command failed to execute: insufficient client permissions (missing permission:b_client_modify_own_description) 2021-04-15 10:11:18.7312| WARN|0|Util.UnwrapToLog custom_error: the command failed to execute: Avatar upload failed: permission_invalid_size: the command failed to execute: invalid size 2021-04-15 10:11:22.1155| INFO||Core.ConsoleInterruptHandler Got interrupt signal, trying to soft-exit. 2021-04-15 10:11:22.1155| INFO||Core.StopAsync TS3AudioBot shutting down. 2021-04-15 10:11:22.1255| INFO||Bot.Stop Bot (0) disconnecting. 2021-04-15 10:11:22.1837| INFO||WebServer.Dispose WebServer is closing 2021-04-15 10:11:22.1852| INFO|Core|WebServer.OnShutdown WebServer has closed 2021-04-15 10:11:22.1852| INFO||Core.StopAsync Bye

Flakebi commented 3 years ago

You need to install ffmpeg and set the path in ts3audiobot.toml:

#The path to ffmpeg.
[tools.ffmpeg]
path = "C:\\path\\to\\ffmpeg.exe"
nektryn commented 3 years ago

@Flakebi Could you please give me a link directly which versions of ffmpeg should I download because there is a bit of it, thanks a lot for your help.

Flakebi commented 3 years ago

Just pick the first one that works I’d say, e.g. ffmpeg-4.4-full_build.7z from here: https://github.com/GyanD/codexffmpeg/releases/tag/4.4

nektryn commented 3 years ago

@Flakebi

The path to ffmpeg.

[tools.ffmpeg] path = "C:\Users\Nektryn\Downloads\ffmpeg-4.4-full_build\ffmpeg-4.4-full_build\bin\ffmpeg.exe"

LOG: 2021-04-16 00:20:38.3884| INFO|Core|Setup.LogHeader [============ TS3AudioBot started =============] 2021-04-16 00:20:38.4254| INFO|Core|Setup.LogHeader [ Date: Friday, 16 April 2021 00:20:38 2021-04-16 00:20:38.5124| INFO|Core|Setup.LogHeader [ Version: 0.12.2/master/4c6be036 2021-04-16 00:20:38.5138| INFO|Core|Setup.LogHeader [ Build: Release 2021-04-16 00:20:38.5138| INFO|Core|Setup.LogHeader [ Platform: Windows 6.2.9200.0 (64bit) 2021-04-16 00:20:38.5138| INFO|Core|Setup.LogHeader [ Runtime: .NET Framework 3.1.13 ServerGC:True GC:SustainedLowLatency 2021-04-16 00:20:38.5138| INFO|Core|Setup.LogHeader [ Opus: libopus 1.2.1-fixed (x64) 2021-04-16 00:20:38.5138| INFO|Core|Setup.LogHeader [==============================================] 2021-04-16 00:20:38.6300|ERROR|Core|ConfRoot.Open Could not load core config. Nett.Parser.ParseException: Line 151, column 8: String 'C:\Users\Nektryn\Downloads\ffmpeg-4.4-full_build\ffmpeg-4.4-full_build\bin\ffmpeg.exe' contains the invalid escape sequence '\U'. at Nett.StringExtensions.<>cDisplayClass4_0.b0(Match m) at System.Text.RegularExpressions.Regex.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat) at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator, Int32 count, Int32 startat) at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator) at Nett.StringExtensions.Unescape(String src, Token tkn) at Nett.Parser.Builders.TableBuilder.<>cDisplayClass6_0.gCreateValueFromTerminal|1(Token terminal) at Nett.Parser.Builders.TableBuilder.<>cDisplayClass6_0.gCreateValue|0(TerminalNode tn) at Nett.Parser.Builders.TableBuilder.ToTomlValue(ITomlRoot root, ValueNode node) at Nett.Parser.Builders.TableBuilder.Build(StartNode node, TomlSettings settings) at Nett.StreamTomlSerializer.Deserialize(Stream s, TomlSettings settings) at Nett.Toml.ReadFile(String filePath, TomlSettings settings) at Nett.Toml.ReadFile(String filePath) at TS3AudioBot.Config.ConfigEnumerable.Load[T](String path) in C:\projects\ts3audiobot\TS3AudioBot\Config\ConfigEnumerable.cs:line 139 2021-04-16 00:20:38.6835|FATAL|Core|Core.UnhandledExceptionHandler Critical program failure! System.Exception: Could not create config at TS3AudioBot.Core.Run(ParameterData setup) in C:\projects\ts3audiobot\TS3AudioBot\Core.cs:line 55 at TS3AudioBot.Setup.StartBot(ParameterData setup) in C:\projects\ts3audiobot\TS3AudioBot\Setup.cs:line 92 at System.Threading.Tasks.Task.<>c.b139_1(Object state) at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b6_0(QueueUserWorkItemCallback quwi) at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action`1 callback, TState& state) at System.Threading.QueueUserWorkItemCallback.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() 2021-04-16 00:20:38.6862| INFO|Core|Core.StopAsync TS3AudioBot shutting down. 2021-04-16 00:20:38.6862| INFO|Core|Core.StopAsync Bye

Flakebi commented 3 years ago

It can’t load the config (ConfRoot.Open Could not load core config.), you need to escape backslashes, so it should look like "C:\\Users\\…".

nektryn commented 3 years ago

LOGS NOW: 2021-04-16 00:26:17.6689| INFO|Core|Setup.LogHeader [============ TS3AudioBot started =============] 2021-04-16 00:26:17.7049| INFO|Core|Setup.LogHeader [ Date: Friday, 16 April 2021 00:26:17 2021-04-16 00:26:17.7889| INFO|Core|Setup.LogHeader [ Version: 0.12.2/master/4c6be036 2021-04-16 00:26:17.7889| INFO|Core|Setup.LogHeader [ Build: Release 2021-04-16 00:26:17.7889| INFO|Core|Setup.LogHeader [ Platform: Windows 6.2.9200.0 (64bit) 2021-04-16 00:26:17.7889| INFO|Core|Setup.LogHeader [ Runtime: .NET Framework 3.1.13 ServerGC:True GC:SustainedLowLatency 2021-04-16 00:26:17.7889| INFO|Core|Setup.LogHeader [ Opus: libopus 1.2.1-fixed (x64) 2021-04-16 00:26:17.7942| INFO|Core|Setup.LogHeader [==============================================] 2021-04-16 00:26:18.3257| INFO|Core|WebServer.StartWebServerInternal Starting Webserver on port 58913 2021-04-16 00:26:18.5211| INFO|Core|Bot.Run Bot "default" connecting to "midov.pl" 2021-04-16 00:26:19.0172| WARN|0|Ts3Client.TsFullClient_OnDisconnected Could not connect: parameter_invalid_size: the command failed to execute: invalid parameter size 2021-04-16 00:26:19.0172| INFO|0|Ts3Client.TryReconnect Trying to reconnect because of Error. Delaying reconnect for 30 seconds 2021-04-16 00:26:49.1383| WARN|0|Ts3Client.TsFullClient_OnDisconnected Could not connect: parameter_invalid_size: the command failed to execute: invalid parameter size 2021-04-16 00:26:49.1383| INFO|0|Ts3Client.TryReconnect Trying to reconnect because of Error. Delaying reconnect for 30 seconds

MY TOML:

! IMPORTANT !

All config tables here starting with 'bot.*' will only be used as default values for each bot.

To make bot-instance specific changes go to the 'Bots' folder (configs.bots_path) and set your configuration values in the desired bot config.

[bot]

This field will be automatically set when you call '!bot setup'.

The bot will use the specified group to set/update the required permissions and add himself into it.

You can set this field manually if you already have a preexisting group the bot should add himself to.

bot_group_id = 0

Tries to fetch a cover image when playing.

generate_status_avatar = true

Sets the description of the bot to the current song title.

set_status_description = true

The language the bot should use to respond to users. (Make sure you have added the required language packs)

language = "en"

Starts the instance when the TS3AudioBot is launched.

run = false

[bot.commands]

Defines how the bot tries to match your !commands. Possible types:

- exact : Only when the command matches exactly.

- substring : The shortest command starting with the given prefix.

- ic3 : 'interleaved continuous character chain' A fuzzy algorithm similar to hamming distance but preferring characters at the start.

matcher = "ic3"

Defines how the bot handles messages which are too long for a single ts3 message. Options are:

- split : The message will be split up into multiple messages.

- drop : Does not send the message.

long_message = "Split"

Limits the split count for long messages. When for example set to 1 the message will simply be trimmed to one message.

long_message_split_limit = 1

Enables colors and text highlights for respones.

color = true

Limits the maximum command complexity to prevent endless loops.

command_complexity = 64

[bot.commands.alias]

[bot.connect]

The server password. Leave empty for none.

server_password = { pw = "", hashed = false, autohash = false }

The default channel password. Leave empty for none.

channel_password = { pw = "", hashed = false, autohash = false }

Overrides the displayed version for the ts3 client. Leave empty for default.

client_version = { build = "", platform = "", sign = "" }

The address, ip or nickname (and port; default: 9987) of the TeamSpeak3 server

address = ""

Default channel when connecting. Use a channel path or "/".

Examples: "Home/Lobby", "/5", "Home/Afk \/ Not Here".

channel = "factoriowanie w factorio"

The client badges. You can set a comma seperated string with max three GUID's. Here is a list: http://yat.qa/ressourcen/abzeichen-badges/

badges = ""

Client nickname when connecting.

name = "JM"

[bot.connect.identity]

||| DO NOT MAKE THIS KEY PUBLIC ||| The client identity. You can import a teamspeak3 identity here too.

key = ""

The client identity offset determining the security level.

offset = 0

The client identity security level which should be calculated before connecting

or -1 to generate on demand when connecting.

level = -1

[bot.reconnect] ontimeout = ["1s", "2s", "5s", "10s", "30s", "1m", "5m", "repeat last"] onkick = [] onban = [] onerror = ["30s", "repeat last"] onshutdown = ["5m"]

[bot.audio]

When a new song starts the volume will be trimmed to between min and max.

When the current volume already is between min and max nothing will happen.

To completely or partially disable this feature, set min to 0 and/or max to 100.

volume = { default = 50.0, min = 25.0, max = 75.0 }

The maximum volume a normal user can request. Only user with the 'ts3ab.admin.volume' permission can request higher volumes.

max_user_volume = 100.0

Specifies the bitrate (in kbps) for sending audio.

Values between 8 and 98 are supported, more or less can work but without guarantees.

Reference values: 16 - very poor (~3KiB/s), 24 - poor (~4KiB/s), 32 - okay (~5KiB/s), 48 - good (~7KiB/s), 64 - very good (~9KiB/s), 96 - deluxe (~13KiB/s)

bitrate = 48

How the bot should play music. Options are:

- whisper : Whispers to the channel where the request came from. Other users can join with '!subscribe'.

- voice : Sends via normal voice to the current channel. '!subscribe' will not work in this mode.

- !... : A custom command. Use '!xecute (!a) (!b)' for example to execute multiple commands.

send_mode = "voice"

[bot.playlists]

[bot.history]

Enable or disable history features completely to save resources.

enabled = true

Whether or not deleted history ids should be filled up with new songs.

fill_deleted_ids = true

[bot.events]

Called when the bot is connected.

onconnect = ""

Called when the bot gets disconnected.

ondisconnect = ""

Called when the bot does not play anything for a certain amount of time.

onidle = ""

Specifies how long the bot has to be idle until the 'onidle' event gets fired.

You can specify the time in the ISO-8601 format "PT30S" or like: 15s, 1h, 3m30s

idletime = "0s"

Called when the last client leaves the channel of the bot. Delay can be specified

onalone = ""

Specifies how long the bot has to be alone until the 'onalone' event gets fired.

You can specify the time in the ISO-8601 format "PT30S" or like: 15s, 1h, 3m30s

alone_delay = "0s"

Called when the bot was alone and a client joins his channel. Delay can be specified.

onparty = ""

Specifies how long the bot has to be alone until the 'onalone' event gets fired.

You can specify the time in the ISO-8601 format "PT30S" or like: 15s, 1h, 3m30s

party_delay = "0s"

Called when a new song starts.

onsongstart = ""

[configs]

Path to a folder where the configuration files for each bot template will be stored.

bots_path = "bots"

Enable to contribute to the global stats tracker to help us improve our service.

We do NOT send/store any IPs, identifiable information or logs for this.

If you want to check how a stats packet looks like you can run the bot with 'TS3AudioBot --stats-example'.

To disable contributing without config you can run the bot with 'TS3AudioBot --stats-disabled'. This will ignore the config value.

send_stats = true

[db]

The path to the database file for persistent data.

path = "ts3audiobot.db"

[factories]

The default path to look for local resources.

media = { path = "" }

[factories.youtube]

Changes how to try to resolve youtube songs

- youtubedl : uses youtube-dl only

- internal : uses the internal resolver, then youtube-dl

prefer_resolver = "Internal"

Set your own youtube api key to keep using the old youtube factory loader.

This feature is unsupported and may break at any time

youtube_api_key = ""

[tools]

Path to the youtube-dl binary or local git repository.

youtube-dl = { path = "" }

The path to ffmpeg.

[tools.ffmpeg] path = "C:\Users\Nektryn\Downloads\ffmpeg-4.4-full_build\ffmpeg-4.4-full_build\bin\ffmpeg.exe"

[rights]

Path to the permission file. The file will be generated if it doesn't exist.

path = "rights.toml"

[plugins]

The path to the plugins folder.

path = "plugins"

[plugins.load]

[web]

An array of all urls the web api should be possible to be accessed with.

hosts = ["*"]

The port for the web server.

port = 58913

[web.api]

If you want to enable the web api.

enabled = true

Limits the maximum command complexity to prevent endless loops.

command_complexity = 64

See: bot.commands.matcher

matcher = "exact"

[web.interface]

If you want to enable the webinterface.

enabled = true

The webinterface folder to host. Leave empty to let the bot look for default locations.

path = ""

nektryn commented 3 years ago

I gave a double and now a new bug

nektryn commented 3 years ago

everything is already working, thanks for your help!