distubejs / ytsr

Do anonymous YouTube search requests. Made for https://DisTube.js.org.
https://distube.js.org
MIT License
10 stars 1 forks source link

API rate limit when checking for updates #2

Closed LuluHuman closed 10 months ago

LuluHuman commented 10 months ago

when checking for updates this will error

node:buffer:323
  throw new ERR_INVALID_ARG_TYPE(
        ^

TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
    at Function.from (node:buffer:323:9)
    at /home/lulu/KaitoBot/node_modules/@distube/ytsr/lib/util.js:291:30
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}

upon tracing to ytsr/lib/util.js:291:30 response return

{
  message: "API rate limit exceeded for IP. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
  documentation_url: 'https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting'
}
skick1234 commented 10 months ago

You can disable this with https://github.com/distubejs/ytsr#update-checks. Just disable it in development and enable in production.

skick1234 commented 10 months ago

Anyway, this should throw ratelimited error, I will update it later

skick1234 commented 10 months ago

Close with https://github.com/distubejs/ytsr/commit/1fe1adea639284d9618562c6e29944cb686aaf28 Forgot to mention this issue in the commit .-.