Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading