YouTube.js icon indicating copy to clipboard operation
YouTube.js copied to clipboard

16.0.1 `getTrending()` function broken due to the removal of the aggregated trending page. Request failed with error 400

Open Fijxu opened this issue 3 weeks ago • 1 comments

Steps to reproduce

  1. Call innertube.getTrending()
  2. Get error: Uncaught (in promise) Error: Request to https://www.youtube.com/youtubei/v1/browse?prettyPrint=false&alt=json failed with status code 400
import { Innertube } from 'youtubei.js';
const innertube = await Innertube.create(/* options */);

const meow = await innertube.getTrending()
console.log(meow)

Tried it with deno

Failure Logs

error: Uncaught (in promise) Error: Request to https://www.youtube.com/youtubei/v1/browse?prettyPrint=false&alt=json failed with status code 400
    at HTTPClient.fetch (file:///home/user/.cache/deno/npm/registry.npmjs.org/youtubei.js/16.0.1/dist/src/utils/HTTPClient.js:94:15)
    at eventLoopTick (ext:core/01_core.js:179:7)
    at async Actions.execute (file:///home/user/.cache/deno/npm/registry.npmjs.org/youtubei.js/16.0.1/dist/src/core/Actions.js:65:26)
    at async Innertube.getTrending (file:///home/user/.cache/deno/npm/registry.npmjs.org/youtubei.js/16.0.1/dist/src/Innertube.js:270:26)
    at async file:///tmp/test/index.ts:4:14

Expected behavior

Fetch the trending tab

Current behavior

Trending tab fails to be fetched

Version

Default

Anything else?

References:

  • https://github.com/iv-org/invidious-companion/issues/236
  • https://github.com/iv-org/invidious/pull/5555
  • https://github.com/TeamNewPipe/NewPipeExtractor/tree/ae2755bf715538dbaed028ecb1a0553c1646710d/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/kiosk
  • https://github.com/iv-org/invidious/issues/5397

Innertube Response:

HTTP/2.0 400 
vary: Origin
vary: X-Origin
vary: Referer
content-type: application/json; charset=UTF-8
date: Thu, 11 Dec 2025 19:56:22 GMT
server: scaffolding on HTTPServer2
content-length: 285
x-xss-protection: 0
x-frame-options: SAMEORIGIN
x-content-type-options: nosniff
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000

{
  "error": {
    "code": 400,
    "message": "Request contains an invalid argument.",
    "errors": [
      {
        "message": "Request contains an invalid argument.",
        "domain": "global",
        "reason": "badRequest"
      }
    ],
    "status": "INVALID_ARGUMENT"
  }
}

Checklist

  • [x] I am running the latest version.
  • [x] I checked the documentation and found no answer.
  • [x] I have searched the existing issues and made sure this is not a duplicate.
  • [x] I have provided sufficient information.

Fijxu avatar Dec 11 '25 20:12 Fijxu

@LuanRT , same 400 error for transcripts , they are no longer working

gr0go avatar Dec 11 '25 21:12 gr0go