Changed Google-Search to Youtube

This commit is contained in:
Lukas Blacha
2023-02-08 12:10:18 +01:00
parent c1e731aa4d
commit 5d58d05668

View File

@@ -84,12 +84,12 @@ else:
before_options="-threads 2", options=ffmpeg_options), data=data) before_options="-threads 2", options=ffmpeg_options), data=data)
class Google(discord.ui.View): class Youtube(discord.ui.View):
def __init__(self, query: str): def __init__(self, query: str):
super().__init__() super().__init__()
# We need to quote the query string to make a valid url. Discord will raise an error if it isn't valid. # We need to quote the query string to make a valid url. Discord will raise an error if it isn't valid.
query = quote_plus(query) query = quote_plus(query)
url = f"https://www.google.com/search?q={query}" url = f"https://www.youtube.com/results?search_query={query}"
# Link buttons cannot be made with the # Link buttons cannot be made with the
# decorator, so we have to manually create one. # decorator, so we have to manually create one.