fent / node-ytdl-core

YouTube video downloader in javascript.
MIT License
4.51k stars 799 forks source link

[question] IPv6Block EADDRNOTAVAIL error #1078

Closed xMiyuka closed 2 years ago

xMiyuka commented 2 years ago

Regarding the new IPv6Block setting: I've used my /48 and /64 blocks and both times result in a bind EADDRNOTAVAIL error.

I was wondering if anyone else is experiencing that and if they have, how did they fix it?

I tried this on a basic linux server with a brand new ipv6 tunnel via tunnel broker and a proper server from a friend and both do it.

We're both kinda lost on why and what could exactly cause this.

TimeForANinja commented 2 years ago

that feature is pretty new and kinda niche - so i don't expect many to use it what you can try to debug is enforce using a single ipv6 to validate your setup

this is what we use internally

options.requestOptions = Object.assign({}, options.requestOptions, {
      family: 6,
      localAddress: utils.getRandomIPv6(options.IPv6Block),
    });

so you should be able to just do

ytdl(xxx, {
  yyy...,
  requestOptions: {
    family: 6,
    localAddress: 'your.one.ipv6.address'
  }
})

to try and remove ytdl-core from the equation...

other than that you can obviously try hosting a local ipv6 server and do a simple get-request using miniget to check your local ipv6 stack...

other than that it's kinda hard to help with networking issues since it's basically all about your setup and configuration 😅

xMiyuka commented 2 years ago

that feature is pretty new and kinda niche - so i don't expect many to use it what you can try to debug is enforce using a single ipv6 to validate your setup

this is what we use internally

options.requestOptions = Object.assign({}, options.requestOptions, {
      family: 6,
      localAddress: utils.getRandomIPv6(options.IPv6Block),
    });

so you should be able to just do

ytdl(xxx, {
  yyy...,
  requestOptions: {
    family: 6,
    localAddress: 'your.one.ipv6.address'
  }
})

to try and remove ytdl-core from the equation...

other than that you can obviously try hosting a local ipv6 server and do a simple get-request using miniget to check your local ipv6 stack...

other than that it's kinda hard to help with networking issues since it's basically all about your setup and configuration 😅

Well try your suggestions for validating things. Tho this is a newer feature, this is something that really works well for ratelimiting on yts side. We used a rotator for a 30k server discord bot and since we rotated ips we never got ratelimited.

itsTKRaz commented 2 years ago

Hello, I'm the friend Miyuka mentioned who owns the server.

Having looked into this personally, this is confirmed an issue on the server side of things. I've set it up correctly and music is being routed through an IPv6 tunnel now.

Thank you.

TimeForANinja commented 2 years ago

np, good to hear it helped you with rate limits feel free to open other issues when u have problems