question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LavaPlayer YouTube request starting to get rate limited

See original GitHub issue

Hi

I’ve recently started to run into an issue where YouTube requests made by lava player start running into a 429 TooManyRequests response. This keeps happening even when I stop the bot and start a private instance with almost no traffic. The only way to fix this seems to be by changing the server instance’s public IP, then all requests work again even under peak traffic until they don’t and then the cycle repeats. Is that part of YouTube trying to shutdown music bots?

[ERROR] 2019-10-15 08:59:25.572 [lava-daemon-pool-info-loader-2-thread-1] UrlAudioLoader - lavaplayer threw an exception while loading track https://www.youtube.com/watch?v=YLHpvjrFpe0
com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Loading information for a YouTube track failed.
        at com.sedmelluq.discord.lavaplayer.tools.ExceptionTools.wrapUnfriendlyExceptions(ExceptionTools.java:43) ~[lavaplayer-1.3.22.jar:?]
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager.loadTrackWithVideoId(YoutubeAudioSourceManager.java:233) ~[lavaplayer-1.3.22.jar:?]
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager.loadFromUrlWithVideoId(YoutubeAudioSourceManager.java:323) ~[lavaplayer-1.3.22.jar:?]
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager.loadFromMainDomain(YoutubeAudioSourceManager.java:260) ~[lavaplayer-1.3.22.jar:?]
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager.loadNonSearch(YoutubeAudioSourceManager.java:330) ~[lavaplayer-1.3.22.jar:?]
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager.loadItemOnce(YoutubeAudioSourceManager.java:189) ~[lavaplayer-1.3.22.jar:?]
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager.loadItem(YoutubeAudioSourceManager.java:128) ~[lavaplayer-1.3.22.jar:?]
        at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.checkSourcesForItemOnce(DefaultAudioPlayerManager.java:437) ~[lavaplayer-1.3.22.jar:?]
        at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.checkSourcesForItem(DefaultAudioPlayerManager.java:419) ~[lavaplayer-1.3.22.jar:?]
        at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.lambda$createItemLoader$0(DefaultAudioPlayerManager.java:218) ~[lavaplayer-1.3.22.jar:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.io.IOException: Invalid status code for video info response: 429
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager.determineFailureReason(YoutubeAudioSourceManager.java:401) ~[lavaplayer-1.3.22.jar:?]
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager.getTrackInfoFromMainPage(YoutubeAudioSourceManager.java:390) ~[lavaplayer-1.3.22.jar:?]
        at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioSourceManager.loadTrackWithVideoId(YoutubeAudioSourceManager.java:201) ~[lavaplayer-1.3.22.jar:?]
        ... 12 more

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
MCOfficercommented, Jun 28, 2020

Checking the linked PR leads you here.

0reactions
Mtik333commented, Jun 28, 2020

@Mtik333 The two current solutions are either to stop requesting YouTube videos for an unknown amount of time (generally several hours / days) or to use IP rotation like MCOfficer linked.

Thanks, I’ll try to find out how to use this IP rotation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How are the big music bots able to use YouTube as their ...
Hi, I've been working on a 24/7 music bot for quite some time and I've noticed that some of my users have been...
Read more >
The great music bot apocalypse on October - Medium
The issue of both bots and websites such as youtubetomp3 (which rely on automatic requests to youtube to get songs) was left mostly...
Read more >
Discord4J / Discord4J Download - JitPack
Official - Automatic rate limiting, automatic reconnection strategies, ... Discord4J 3.2.x includes simpler and more powerful APIs to build requests, ...
Read more >
Google has killed Discord's best music bot | Hacker News
I'd take a bet that the email chain that began the process to send Groovy the C&D started with one of the companies...
Read more >
com.sedmelluq.discord.lavaplayer.track.AudioPlaylist Example
YOUTUBE ); } /** * Checks if the search request is directed at YouTube and if we're * still on a cooldown due...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found