Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8.2.0 getPlaylist => 400 Error #574

Open
4 tasks done
kms0219kms opened this issue Jan 11, 2024 · 8 comments
Open
4 tasks done

8.2.0 getPlaylist => 400 Error #574

kms0219kms opened this issue Jan 11, 2024 · 8 comments
Labels
bug Something isn't working help wanted Extra attention is needed priority: medium

Comments

@kms0219kms
Copy link

Steps to reproduce

Use this simple code to reproduce:

import { Innertube, UniversalCache } from 'youtubei.js';

const yt = await Innertube.create({
  cache: new UniversalCache(false)
});

async function main(id: string) {
  const playlist = await yt.getPlaylist(id)
  console.log("videos =>", playlist.videos)
  console.log("total =>", playlist.videos.length)
  return playlist
}

main(<VALID_PLAYLIST_ID>)

Failure Logs

file:///home/runner/innertube-playlist-typescript/node_modules/youtubei.js/dist/src/utils/HTTPClient.js:99
            throw new InnertubeError(`Request to ${response.url} failed with status ${response.status}`, yield response.text());
                  ^

InnertubeError: Request to https://www.youtube.com/youtubei/v1/browse?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&prettyPrint=false&alt=json failed with status 400
    at HTTPClient.<anonymous> (/home/runner/innertube-playlist-typescript/node_modules/youtubei.js/src/utils/HTTPClient.ts:145:11)
    at Generator.next (<anonymous>)
    at fulfilled (/home/runner/innertube-playlist-typescript/node_modules/tslib/tslib.js:166:62)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  info: '{\n' +
    '  "error": {\n' +
    '    "code": 400,\n' +
    '    "message": "Request contains an invalid argument.",\n' +
    '    "errors": [\n' +
    '      {\n' +
    '        "message": "Request contains an invalid argument.",\n' +
    '        "domain": "global",\n' +
    '        "reason": "badRequest"\n' +
    '      }\n' +
    '    ],\n' +
    '    "status": "INVALID_ARGUMENT"\n' +
    '  }\n' +
    '}\n',
  date: 2024-01-11T03:41:00.717Z,
  version: '8.2.0'
}

Node.js v18.12.1

Expected behavior

Returns object that is typed with "Playlist" instance.

Current behavior

Got 400 error

Version

Default

Anything else?

No response

Checklist

  • I am running the latest version.
  • I checked the documentation and found no answer.
  • I have searched the existing issues and made sure this is not a duplicate.
  • I have provided sufficient information.
@kms0219kms kms0219kms added the bug Something isn't working label Jan 11, 2024
@kms0219kms
Copy link
Author

I got it. It is working sometimes (not everytime), so I will still open this issue; please have a look for me.

@LuanRT LuanRT added help wanted Extra attention is needed priority: medium labels Jan 12, 2024
@llsc12
Copy link

llsc12 commented Jan 22, 2024

I get the same error, but with the iOS client on getChannel

@absidue
Copy link
Collaborator

absidue commented Jan 22, 2024

@llsc12 Most of the library only supports the WEB client, the iOS one is only there so you can use it with getBasicInfo. See #555 for more information.

@kms0219kms
Copy link
Author

bump

@kms0219kms
Copy link
Author

Any updates?

@absidue
Copy link
Collaborator

absidue commented Feb 20, 2024

@kms0219kms Could you please provide some examples of playlist IDs that don't work for you?

@kms0219kms
Copy link
Author

@absidue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed priority: medium
Projects
None yet
Development

No branches or pull requests

4 participants