Splamy / TS3AudioBot

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

Youtube Shorts not supported? #1026

Open almatross opened 1 year ago

almatross commented 1 year ago

I was trying to play a youtube short with

!pl https://www.youtube.com/shorts/OOXZx0QkY04

That returned a Error: Could not load. (youtube: The id could not get parsed.)

This is the stack trace

2023-03-18 12:16:24.3274|DEBUG|0|Bot.TryCatchCommand Command Error (Could not load. (youtube: The id could not get parsed.))                                                     TS3AudioBot.AudioBotException: Could not load. (youtube: The id could not get parsed.)
   at TS3AudioBot.ResourceFactories.ResourceResolver.Load(ResolveContext ctx, String message, String audioType) in C:\projects\ts3audiobot\TS3AudioBot\ResourceFactories\ResourceResolver.cs:line 136
   at TS3AudioBot.Audio.PlayManager.Play(InvokerData invoker, String link, String audioType, PlayInfo meta) in C:\projects\ts3audiobot\TS3AudioBot\Audio\PlayManager.cs:line 122    at TS3AudioBot.MainCommands.CommandPlay(PlayManager playManager, InvokerData invoker, String url, String[] attributes) in C:\projects\ts3audiobot\TS3AudioBot\MainCommands.cs:line 1195
   at TS3AudioBot.CommandSystem.Commands.FunctionCommand.ExecuteFunction(Object[] parameters) in C:\projects\ts3audiobot\TS3AudioBot\CommandSystem\Commands\FunctionCommand.cs:line 81
   at TS3AudioBot.CommandSystem.Commands.FunctionCommand.Execute(ExecutionInformation info, IReadOnlyList`1 arguments) in C:\projects\ts3audiobot\TS3AudioBot\CommandSystem\Commands\FunctionCommand.cs:line 203
   at TS3AudioBot.CommandSystem.BotCommand.Execute(ExecutionInformation info, IReadOnlyList`1 arguments) in C:\projects\ts3audiobot\TS3AudioBot\CommandSystem\BotCommand.cs:line 131                                                                                                                                                                                 at TS3AudioBot.CommandSystem.Commands.OverloadedFunctionCommand.Execute(ExecutionInformation info, IReadOnlyList`1 arguments) in C:\projects\ts3audiobot\TS3AudioBot\CommandSystem\Commands\OverloadedFunctionCommand.cs:line 84
   at TS3AudioBot.CommandSystem.Commands.CommandGroup.Execute(ExecutionInformation info, IReadOnlyList`1 arguments) in C:\projects\ts3audiobot\TS3AudioBot\CommandSystem\Commands\CommandGroup.cs:line 63                                                                                                                                                            at TS3AudioBot.CommandSystem.Commands.RootCommand.Execute(ExecutionInformation info, IReadOnlyList`1 arguments) in C:\projects\ts3audiobot\TS3AudioBot\CommandSystem\Commands\RootCommand.cs:line 41
   at TS3AudioBot.CommandSystem.CommandManager.Execute(ExecutionInformation info, String command) in C:\projects\ts3audiobot\TS3AudioBot\CommandSystem\CommandManager.cs:line 401   at TS3AudioBot.Bot.<>c__DisplayClass42_0.<<CallScript>b__0>d.MoveNext() in C:\projects\ts3audiobot\TS3AudioBot\Bot.cs:line 503
--- End of stack trace from previous location where exception was thrown ---
   at TS3AudioBot.Bot.TryCatchCommand(ExecutionInformation info, Boolean answer, Func`1 action) in C:\projects\ts3audiobot\TS3AudioBot\Bot.cs:line 530
2023-03-18 12:16:24.4520|DEBUG|0|TsFullClient.SendCommandBase [O] sendtextmessage targetmode=3 target=1 msg=[B][COLOR=red]Error:\s[\/B]Could\snot\sload.\s(youtube:\sThe\sid\scould\snot\sget\sparsed.) return_code=3

I'm guessing this is just not supported or am I doing something wrong? yt-dlp downloads the youtube short normally

Flakebi commented 1 year ago

YouTube shorts were indeed not working because the bot failed to extract the video id. I pushed a fix to the develop branch, it should work now.

almatross commented 1 year ago

Thanks. I cannot test it unfortunately as the howto for build for Linux keeps failing for dotnet5

/usr/share/dotnet/sdk/5.0.408/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 6.0.  Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0. [/home/alma/ts3audiobotbuild/TS3AudioBot/TSLib/TSLib.csproj]

dotnet 6 also didn't work as there were serveral errors like

/home/alma/ts3audiobotbuild/TS3AudioBot/TSLib/TSLibAutogen/TSLibAutogen.Autogen/Messages.g.cs(5873,10): error CS0246: The type or namespace name 'IconHash' could not be found (are you missing a using directive or an assembly reference?) [/home/alma/ts3audiobotbuild/TS3AudioBot/TSLib/TSLib.csproj] 
Flakebi commented 1 year ago

Can you check if your submodules are up-to-date? git status should say that ‘Your branch is up to date’. You can always run git submodule update --init --recursive if you are unsure. Also, can you try dotnet 6 and running dotnet run -c Release --project TS3AudioBot?

That is working for me.

Sounds like the build instructions are out-of-date as they still refer to .net 5.

almatross commented 1 year ago

Working for me too now. Thanks.

DeadLyBro commented 10 months ago

or change url like this; youtube.com/shorts/id to youtube.com/watch?v=id

I'm using yt-dlp. Idk if its work with youtube-dl.