diff --git a/redbot/cogs/audio/manager.py b/redbot/cogs/audio/manager.py index 7023d10f33c..e04d31584cb 100644 --- a/redbot/cogs/audio/manager.py +++ b/redbot/cogs/audio/manager.py @@ -299,7 +299,7 @@ def __ge__(self, other: object) -> bool: class ServerManager: JAR_VERSION: Final[str] = LavalinkVersion(3, 7, 11, red=3) - YT_PLUGIN_VERSION: Final[str] = "1.4.0" + YT_PLUGIN_VERSION: Final[str] = "1.5.1" LAVALINK_DOWNLOAD_URL: Final[str] = ( "https://github.com/Cog-Creators/Lavalink-Jars/releases/download/" diff --git a/redbot/cogs/audio/utils.py b/redbot/cogs/audio/utils.py index fa123ae6f14..e3b5a541aba 100644 --- a/redbot/cogs/audio/utils.py +++ b/redbot/cogs/audio/utils.py @@ -8,7 +8,7 @@ from enum import Enum, unique from pathlib import Path -from typing import MutableMapping, Tuple, Union +from typing import Any, MutableMapping, Tuple, Union import discord import psutil @@ -83,6 +83,24 @@ def get_jar_ram_defaults() -> Tuple[str, str]: "yaml__logging__level__lavalink": "INFO", "yaml__logging__logback__rollingpolicy__max_history": 15, "yaml__logging__logback__rollingpolicy__max_size": "10MB", + # plugin configuration - note that the plugin may be disabled by the manager + "yaml__plugins__youtube__enabled": True, + "yaml__plugins__youtube__allowSearch": True, + "yaml__plugins__youtube__allowDirectVideoIds": True, + "yaml__plugins__youtube__allowDirectPlaylistIds": True, + "yaml__plugins__youtube__clients": [ + "MUSIC", + "WEB", + "ANDROID_TESTSUITE", + "TVHTML5EMBEDDED", + "ANDROID_LITE", + "MEDIA_CONNECT", + "IOS", + ], + "yaml__plugins__youtube__WEB__playback": True, + "yaml__plugins__youtube__TVHTML5EMBEDDED__playlistLoading": False, + "yaml__plugins__youtube__TVHTML5EMBEDDED__videoLoading": False, + "yaml__plugins__youtube__TVHTML5EMBEDDED__searching": False, } DEFAULT_LAVALINK_SETTINGS = { @@ -110,17 +128,16 @@ def convert_function(key: str) -> str: def change_dict_naming_convention(data) -> dict: - new = {} - for k, v in data.items(): - new_v = v - if isinstance(v, dict): - new_v = change_dict_naming_convention(v) - elif isinstance(v, list): - new_v = list() - for x in v: - new_v.append(change_dict_naming_convention(x)) - new[convert_function(k)] = new_v - return new + ret: Any = data + if isinstance(data, dict): + ret = {} + for key, value in data.items(): + ret[convert_function(key)] = change_dict_naming_convention(value) + elif isinstance(data, list): + ret = [] + for value in data: + ret.append(change_dict_naming_convention(value)) + return ret class CacheLevel: