retrouser955 / discord-player-youtubei

Super charging your bot. dpy is a tiny extractor module to test the validity of youtubei.js in discord-player version 7.
https://discord-player.js.org
Creative Commons Zero v1.0 Universal
22 stars 5 forks source link

com.retrouser955.discord-player.discord-player-youtubei extractor failed to activate! Error: Error: Request #27

Open Strayneko opened 5 days ago

Strayneko commented 5 days ago

Before you report a bug ...

Description of the bug

can't use youtube cookie generated by $ npx --no discord-player-youtubei to initialize discord player youtubei.

Steps to reproduce

  1. run $ npx --no discord-player-youtubei
  2. paste the generated youtube cookie into config

Screenshot(s)

image

Versioning

discord-player: 6.7.1 node.js: 20.18.0

Others

logs

com.retrouser955.discord-player.discord-player-youtubei extractor failed to activate! Error: Error: Request to https://www.youtube.com/youtubei/v1/account/accounts_list?prettyPrint=false&alt=json failed with status 400
<ref *2> ExtractorExecutionContext {
  _events: [Object: null prototype] {},
  _eventsCount: 0,
  _maxListeners: undefined,
  requiredEvents: [ 'error' ],
  player: <ref *1> Player {
    _events: [Object: null prototype] {
      debug: [Function (anonymous)],
      error: [Array]
    },
    _eventsCount: 2,
    _maxListeners: undefined,
    requiredEvents: [ 'error' ],
    id: '1298989001499217920',
    nodes: GuildNodeManager {
      player: [Circular *1],
      cache: Collection(0) [Map] {}
    },
    voiceUtils: VoiceUtils { player: [Circular *1], cache: Collection(0) [Map] {} },
    extractors: [Circular *2],
    events: PlayerEventsEmitter {
      _events: [Object: null prototype],
      _eventsCount: 4,
      _maxListeners: undefined,
      requiredEvents: [Array],
      [Symbol(shapeMode)]: false,
      [Symbol(kCapture)]: false
    },
    routePlanner: null,
    version: '6.7.1',
    lyrics: LrcLib {
      player: [Circular *1],
      api: 'https://lrclib.net/api',
      timeout: 15000,
      bucket: [SequentialBucket]
    },
    client: Client {
      _events: [Object: null prototype],
      _eventsCount: 4,
      _maxListeners: 11,
      options: [Object],
      rest: [REST],
      ws: [WebSocketManager],
      actions: [ActionsManager],
      voice: [ClientVoiceManager],
      shard: null,
      users: UserManager {},
      guilds: GuildManager {},
      channels: ChannelManager {},
      sweepers: [Sweepers],
      presence: [ClientPresence],
      user: null,
      application: null,
      readyTimestamp: null,
      [Symbol(shapeMode)]: false,
      [Symbol(kCapture)]: true
    },
    options: {
      lockVoiceStateHandler: false,
      blockExtractors: [],
      blockStreamFrom: [],
      connectionTimeout: 20000,
      lagMonitor: 30000,
      queryCache: [RedisQueryCache],
      useLegacyFFmpeg: false,
      skipFFmpeg: false,
      probeTimeout: 5000,
      ytdlOptions: [Object]
    },
    [Symbol(shapeMode)]: false,
    [Symbol(kCapture)]: false
  },
  store: Collection(3) [Map] {
    'com.discord-player.spotifyextractor' => SpotifyExtractor {
      context: [Circular *2],
      options: {},
      priority: 1,
      protocols: [Array],
      createBridgeQuery: [Function: createBridgeQuery],
      _credentials: [Object],
      internal: [SpotifyAPI],
      _lib: [Object]
    },
    'com.discord-player.applemusicextractor' => AppleMusicExtractor {
      context: [Circular *2],
      options: {},
      priority: 1,
      protocols: [Array],
      createBridgeQuery: [Function: createBridgeQuery]
    },
    'com.discord-player.soundcloudextractor' => SoundCloudExtractor {
      context: [Circular *2],
      options: {},
      priority: 1,
      protocols: [Array],
      createBridgeQuery: [Function: createBridgeQuery],
      internal: [Soundcloud]
    }
  },
  [Symbol(shapeMode)]: false,
  [Symbol(kCapture)]: false
} _YoutubeiExtractor {
  context: <ref *1> ExtractorExecutionContext {
    _events: [Object: null prototype] {},
    _eventsCount: 0,
    _maxListeners: undefined,
    requiredEvents: [ 'error' ],
    player: Player {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      requiredEvents: [Array],
      id: '1298989001499217920',
      nodes: [GuildNodeManager],
      voiceUtils: [VoiceUtils],
      extractors: [Circular *1],
      events: [PlayerEventsEmitter],
      routePlanner: null,
      version: '6.7.1',
      lyrics: [LrcLib],
      client: [Client],
      options: [Object],
      [Symbol(shapeMode)]: false,
      [Symbol(kCapture)]: false
    },
    store: Collection(3) [Map] {
      'com.discord-player.spotifyextractor' => [SpotifyExtractor],
      'com.discord-player.applemusicextractor' => [AppleMusicExtractor],
      'com.discord-player.soundcloudextractor' => [SoundCloudExtractor]
    },
    [Symbol(shapeMode)]: false,
    [Symbol(kCapture)]: false
  },
  options: {
    authentication: THE_GENERATED_YOUTUBE_COOKIE
  },
  priority: 2,
  protocols: [ 'ytsearch', 'youtube' ],
  createBridgeQuery: [Function: createBridgeQuery],
  innerTube: Innertube {},
  _stream: [Function (anonymous)]
} InnertubeError: Request to https://www.youtube.com/youtubei/v1/account/accounts_list?prettyPrint=false&alt=json failed with status 400
    at HTTPClient.fetch (/home/ren/dev/playground/node/KuuhakuBot/node_modules/youtubei.js/bundle/node.cjs:2058:11)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Actions.execute (/home/ren/dev/playground/node/KuuhakuBot/node_modules/youtubei.js/bundle/node.cjs:18939:22)
    at async AccountManager.getInfo (/home/ren/dev/playground/node/KuuhakuBot/node_modules/youtubei.js/bundle/node.cjs:26946:22)
    at async _YoutubeiExtractor.activate (/home/ren/dev/playground/node/KuuhakuBot/node_modules/discord-player-youtubei/dist/index.js:310:22)
    at async _ExtractorExecutionContext.register (/home/ren/dev/playground/node/KuuhakuBot/node_modules/discord-player/src/extractors/ExtractorExecutionContext.ts:124:13) {
  info: '{\n' +
    '  "error": {\n' +
    '    "code": 400,\n' +
    '    "message": "Request contains an invalid argument.",\n' +
    '    "status": "INVALID_ARGUMENT"\n' +
    '  }\n' +
    '}\n',
  date: 2024-10-24T12:38:32.740Z,
  version: '10.5.0'
}
retrouser955 commented 4 days ago

The bug is coming from an external dependency that I have no control over so there's really nothing we can do other than wait. In the mean time, you can catch the error and register the extractor without signing in.

Loadren commented 4 days ago

The bug is coming from an external dependency that I have no control over so there's really nothing we can do other than wait. In the mean time, you can catch the error and register the extractor without signing in.

Do you have perhaps more information on which external dependency conflicts with your extractor?

retrouser955 commented 3 days ago

The bug is coming from an external dependency that I have no control over so there's really nothing we can do other than wait. In the mean time, you can catch the error and register the extractor without signing in.

Do you have perhaps more information on which external dependency conflicts with your extractor?

It's not a conflict, it's an error coming from the core dependency youtubei.js regarding the current TV login process used due to an error in the token.