Closed Freetoplay951 closed 4 months ago
Use IP rotation.
Oh okay, I "only" found
AbstractRouterPlanner routePlanner = new ...
YoutubeIpRotatorSetup rotator = new YoutubeIpRotatorSetup(routePlanner);
rotator.forConfiguration(youtube.getHttpInterfaceManager(), false)
.withMainDelegateFilter(null) // This is important, otherwise you may get NullPointerExceptions.
.setup();
for that... sadly I never worked with routePlanners, so I dont know how to use them - do you maybe have an example or a documentation for it which explains how to use it?
Pick a route planner from this list, instantiate it and pass it to the YoutubeIpRotatorSetup
class.
I personally would go for RotatingNanoIp
It doesnt know YoutubeIpRotatorSetup for me for some reason - have I to add something to my gradle?
dev.arbjerg:lavaplayer-ext-youtube-rotator:<LAVAPLAYER-VERSION>
replace <LAVAPLAYER-VERSION>
with the version of Lavaplayer that you are using, e.g. 1.5.4
, 2.1.2
, ...
thanks
Is there an example for using RotatingNanoIp
So I tried:
YoutubeAudioSourceManager youtubeProvider = new YoutubeAudioSourceManager(true, new MusicWithThumbnail(), new WebWithThumbnail(), new AndroidWithThumbnail());
RotatingNanoIpRoutePlanner routePlanner = new RotatingNanoIpRoutePlanner(Collections.singletonList(
new Ipv6Block(Utils.getIPAddress() + "::/64")
));
YoutubeIpRotatorSetup rotator = new YoutubeIpRotatorSetup(routePlanner);
rotator.forConfiguration(youtubeProvider.getHttpInterfaceManager(), false)
.withMainDelegateFilter(null) // This is important, otherwise you may get NullPointerExceptions.
.setup();
audioPlayerManager.registerSourceManager(youtubeProvider);
with Utils.getIPAdress() being:
public static String getIPAddress() {
try {
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
NetworkInterface networkInterface = interfaces.nextElement();
Enumeration<InetAddress> addresses = networkInterface.getInetAddresses();
while (addresses.hasMoreElements()) {
InetAddress inetAddress = addresses.nextElement();
if (inetAddress instanceof java.net.Inet6Address) {
return inetAddress.getHostAddress();
}
}
}
} catch (SocketException e) {
e.printStackTrace();
}
return null;
}
But sadly it doesnt work at all xD
You need a routed v6 block, ideally a /48 subnet. You can see if your provider will offer one or alternatively check out https://tunnelbroker.net/ but I think this is straying too far from what's suitable for a GitHub issue. You're free to join our Discord server if you need further help. For now, I'll be closing this issue but if it appears there's a genuine issue that isn't resolved by IP rotation, I will reopen this.
Hello, is there a way to bypass this error? I get it when using my music bot on my server - when running it locally it works without any problems. Hope that there's a solution for it...