zyrouge / node-genius-lyrics

Simple lyrics fetcher that uses Genius. Also has official API implementations.
https://genius-lyrics.js.org
MIT License
61 stars 12 forks source link

IPV6 support #47

Closed Jelmerro closed 1 year ago

Jelmerro commented 1 year ago

Both the scraping and the regular API stop working when a device supports IPV6: image The api url is converted to an IPV6 address instead of the working IPV4 one, could we have an option to always use IPV4 for the API?

zyrouge commented 1 year ago

Never tried to force IPV4, could you possibly PR this?

Jelmerro commented 1 year ago

Sorry, I don't have a clue where this is breaking, I can see the url being correct, and all the parameters too, but then the actual request translates the url to an IPV6 address and then everything breaks. This is not my expertise sadly, but I did notice a pattern, because if I disable IPV6 it works flawlessly again.

Jelmerro commented 1 year ago

Seems like this is an issue upstream as well, but no solution to be found so far: https://github.com/nodejs/undici/issues/1413

zyrouge commented 1 year ago

Seems like this is an issue upstream as well, but no solution to be found so far: nodejs/undici#1413

That's one hell of a weird issue.

Jelmerro commented 1 year ago
const dns = require("dns")
dns.setDefaultResultOrder("ipv4first")

Adding the above seems to fix it for now, and apparently they are working to make this better in NodeJS 20. Sorry wasting your time on this issue when it was not a problem of your project but in NodeJS/undici.

csj90 commented 12 months ago

where can i put that ?