Skip to content

Commit

Permalink
Bump YT source plugin version to 1.5.1 and add custom plugin config (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen authored Aug 4, 2024
1 parent 699471f commit 7eb26da
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
2 changes: 1 addition & 1 deletion redbot/cogs/audio/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
41 changes: 29 additions & 12 deletions redbot/cogs/audio/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 7eb26da

Please sign in to comment.