Bump YT source plugin version to 1.5.1 and add custom plugin config (#6415)

This commit is contained in:
Jakub Kuczys 2024-08-04 21:33:59 +02:00 committed by GitHub
parent 699471f27a
commit 7eb26da647
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 13 deletions

View File

@ -299,7 +299,7 @@ class LavalinkVersion:
class ServerManager: class ServerManager:
JAR_VERSION: Final[str] = LavalinkVersion(3, 7, 11, red=3) 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] = ( LAVALINK_DOWNLOAD_URL: Final[str] = (
"https://github.com/Cog-Creators/Lavalink-Jars/releases/download/" "https://github.com/Cog-Creators/Lavalink-Jars/releases/download/"

View File

@ -8,7 +8,7 @@ import time
from enum import Enum, unique from enum import Enum, unique
from pathlib import Path from pathlib import Path
from typing import MutableMapping, Tuple, Union from typing import Any, MutableMapping, Tuple, Union
import discord import discord
import psutil import psutil
@ -83,6 +83,24 @@ DEFAULT_LAVALINK_YAML = {
"yaml__logging__level__lavalink": "INFO", "yaml__logging__level__lavalink": "INFO",
"yaml__logging__logback__rollingpolicy__max_history": 15, "yaml__logging__logback__rollingpolicy__max_history": 15,
"yaml__logging__logback__rollingpolicy__max_size": "10MB", "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 = { DEFAULT_LAVALINK_SETTINGS = {
@ -110,17 +128,16 @@ def convert_function(key: str) -> str:
def change_dict_naming_convention(data) -> dict: def change_dict_naming_convention(data) -> dict:
new = {} ret: Any = data
for k, v in data.items(): if isinstance(data, dict):
new_v = v ret = {}
if isinstance(v, dict): for key, value in data.items():
new_v = change_dict_naming_convention(v) ret[convert_function(key)] = change_dict_naming_convention(value)
elif isinstance(v, list): elif isinstance(data, list):
new_v = list() ret = []
for x in v: for value in data:
new_v.append(change_dict_naming_convention(x)) ret.append(change_dict_naming_convention(value))
new[convert_function(k)] = new_v return ret
return new
class CacheLevel: class CacheLevel: