Skip to content

Commit

Permalink
Fixed inconsistency involving playing Youtube music
Browse files Browse the repository at this point in the history
  • Loading branch information
PieTw3lve committed Aug 15, 2024
1 parent 7766503 commit 8a78bbe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
21 changes: 11 additions & 10 deletions Lavalink/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@ plugins:
# Clients are queried in the order they are given (so the first client is queried first and so on...)
clients:
- MUSIC
- ANDROID
- ANDROID_MUSIC
- TVHTML5EMBEDDED
- WEB
# You can configure individual clients with the following.
# Any options or clients left unspecified will use their default values,
# which enables everything for all clients.
WEB: # names are specified as they are written below under "Available Clients".
# This will disable using the WEB client for video playback.
playback: false
TVHTML5EMBEDDED:
# The below config disables everything except playback for this client.
playlistLoading: false # Disables loading of playlists and mixes for this client.
videoLoading: false # Disables loading of videos for this client (playback is still allowed).
searching: false # Disables the ability to search for videos for this client.
# WEB: # names are specified as they are written below under "Available Clients".
# # This will disable using the WEB client for video playback.
# playback: false
# videoLoading: false # Disables loading of videos for this client. A client may still be used for playback even if this is set to 'false'.
# TVHTML5EMBEDDED:
# # The below config disables everything except playback for this client.
# videoLoading: false # Disables loading of videos for this client (playback is still allowed).
# searching: false # Disables the ability to search for videos for this client.
lavalink:
plugins:
# Replace VERSION with the current version as shown by the Releases tab or a long commit hash for snapshots.
- dependency: 'dev.lavalink.youtube:youtube-plugin:1.5.1'
- dependency: 'dev.lavalink.youtube:youtube-plugin:1.6.0'
snapshot: false # Set to true if you want to use a snapshot version.
pluginsDir: './plugins'
server:
Expand Down
5 changes: 4 additions & 1 deletion src/extensions/general/music.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,11 @@ async def search_autocomplete(opt: hikari.AutocompleteInteractionOption, inter:
# Check if the user input might be a URL. If it isn't, we can Lavalink do a YouTube search for it instead.
url_rx = re.compile(r'https?://(?:www\.)?.+')
if not url_rx.match(query):
ytquery = f'ytsearch:{query}'
ytquery = f'ytmsearch:{query}'
scquery = f'scsearch:{query}'
else:
ytquery = query
scquery = query

# Get the results for the query from Lavalink.
if len(opt.value) > 0 and len(opt.value) <= 100:
Expand Down

0 comments on commit 8a78bbe

Please sign in to comment.