need helpp
CAUESPINDOLA

Does anyone know what I'm doing wrong? it's a command in python I'm doing for discord please i need help!! cod: @client.command()
async def Youtube(ctx, *, search):
query_string = urllib.parse.urlencode({
'search_query': search
})
htm_content = urllib.request.urlopen(
'http://www.youtube.com/results?'+ query_string
)
search_results = re.findall('href=\"\?watch\?v=(.{11})', htm_content.read().decode())
await ctx.send(f'http://www.youtube.com/watchv=' + search_results[0])

You are viewing a single comment. View All
InvisibleOne

change the first line to async def Youtube(ctx, search): you don't need the * just enclose the search in quotes if it is more then one word. * will return everything as a tuple or list I think