diff --git a/Music-Bot.py b/Music-Bot.py index c75f66d..eb76d6f 100644 --- a/Music-Bot.py +++ b/Music-Bot.py @@ -97,8 +97,8 @@ else: p = {"search_query": query} # Spoof a user agent header or the request will immediately fail h = {"User-Agent": "Mozilla/5.0"} - async with aiohttp.ClientSession() as client: - async with client.get("https://www.youtube.com/results", params=p, headers=h) as resp: + with aiohttp.ClientSession() as client: + with client.get("https://www.youtube.com/results", params=p, headers=h) as resp: dom = await resp.text() # open("debug.html", "w").write(dom) found = re.findall(r'href"\/watch\?v=([a-zA-Z0-9_-]{11})', dom)