Wavelink search error discord music streaming bot

Question:

I’ve been building a discord streaming bot per the tutorial by Alexa (robotic nation) ran into some node errors recently but fixed those with the help of this website but now I’ve encountered an error with the play (track) command in my code that is a direct copy from Alexa’s code I’ve tried to lookup the error on here and other sites but it seems no one else has had this issue yet

—–the error—–

discord.ext.commands.errors.ConversionError: (<class 'wavelink.tracks.YouTubeTrack'>, LoadTrackError('Something went wrong when looking up the track'))

—–the command—–

@bot.command()
async def play(ctx, *, search: wavelink.YouTubeTrack):
    vc = ctx.voice_client
    if not vc:
        custom_player = CustomPlayer()
        vc: CustomPlayer = await ctx.author.voice.channel.connect(cls=custom_player)

    if vc.is_playing():

        vc.queue.put(item=search)

        await ctx.send(embed=discord.Embed(
            title=search.title,
            url=search.uri,
            author=ctx.author,
            description=f"Queued {search.title} in {vc.channel}"
        ))
    else:
        await vc.play(search)

        await ctx.send(embed=discord.Embed(
            title=vc.source.title,
            url=vc.source.uri,
            author=ctx.author,
            description=f"Playing {vc.source.title} in {vc.channel}"
        ))

I hope someone has a solution or has seen this error before that can help

its been a few days now with no responses but plenty of views

the error still persists I’ve referred to the wavelink documentation to no avail, simply putting that the failed to load track error means just that, failed to load track (very helpful wavelink) i’ve tried usign quotes to make it a valid string I’ve even tried using yt links still with no luck every time getting the exact same error

(<class 'wavelink.tracks.YouTubeTrack'>, LoadTrackError('Something went wrong when looking up the track'))

another few days have gone by with no helpful input
i have deduced the issue is coming directly from the async def line no idea whats wrong with it but it always errors right at this line

async def play(ctx, *, search: wavelink.YouTubeTrack):
Asked By: newtboot

||

Answers:

java was outdated (was running java jdk 13.0.1) needed to update to java jdk 15+ this fixed the issue completely

sadly no one on here for weeks helped and i had to figure it out through suggestions from fellow coding friends until i found that despite the tutorial saying "strictly jdk 13" after updating to jdk 15+ all the errors subsided

please also note if this doesn’t help to solve your error i also updated lavalink from v3.4 to v3.5.1 the link for lavalink will be bellow

lavalink github repo

if you are like me and hosting your bot via a raspberry pi running rasbian buster you can go to the menu>preferences>add/remove software and type in the search bar openjdk and you can select the proper version from the list and click ok or apply

Answered By: newtboot
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.