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

9.0.2 [YOUTUBEJS][Parser]: InnertubeError: ClientSideToggleMenuItem not found! #595

Open
4 tasks done
foltia opened this issue Feb 9, 2024 · 1 comment
Open
4 tasks done
Labels
bug Something isn't working priority: medium

Comments

@foltia
Copy link

foltia commented Feb 9, 2024

Steps to reproduce

I got the video information using the code below.

import { Innertube } from "youtubei.js"

const yt = await Innertube.create()

let info = await yt.getInfo("hLMBmySD9io")

Failure Logs

[YOUTUBEJS][Parser]: InnertubeError: ClientSideToggleMenuItem not found!
This is a bug, want to help us fix it? Follow the instructions at https://github.com/LuanRT/YouTube.js/blob/main/docs/updating-the-parser.md or report it at https://github.com/LuanRT/YouTube.js/issues!
Introspected and JIT generated this class in the meantime:
class ClientSideToggleMenuItem extends YTNode {
  static type = 'ClientSideToggleMenuItem';

  default_text: Text;
  default_icon: {
    icon_type: string
  };
  toggled_text: Text;
  toggled_icon: {
    icon_type: string
  };
  menu_item_identifier: string;
  command: {
    click_tracking_params: string,
    toggle_live_chat_timestamps_endpoint: NavigationEndpoint
  };

  constructor(data: RawNode) {
    super();
    this.default_text = new Text(data.defaultText);
    this.default_icon = {
      icon_type: data.defaultIcon.iconType
    };
    this.toggled_text = new Text(data.toggledText);
    this.toggled_icon = {
      icon_type: data.toggledIcon.iconType
    };
    this.menu_item_identifier = data.menuItemIdentifier;
    this.command = {
      click_tracking_params: data.command.clickTrackingParams,
      toggle_live_chat_timestamps_endpoint: new NavigationEndpoint(data.command.toggleLiveChatTimestampsEndpoint)
    };
  }
}

    at ERROR_HANDLER (file:///home/user/Documents/yt-player/node_modules/youtubei.js/dist/src/parser/parser.js:66:27)
    at createRuntimeClass (file:///home/user/Documents/yt-player/node_modules/youtubei.js/dist/src/parser/generator.js:322:5)
    at generateRuntimeClass (file:///home/user/Documents/yt-player/node_modules/youtubei.js/dist/src/parser/generator.js:374:21)
    at parseItem (file:///home/user/Documents/yt-player/node_modules/youtubei.js/dist/src/parser/parser.js:361:17)
    at Module.parseArray (file:///home/user/Documents/yt-player/node_modules/youtubei.js/dist/src/parser/parser.js:404:28)
    at new Menu (file:///home/user/Documents/yt-player/node_modules/youtubei.js/dist/src/parser/classes/menus/Menu.js:6:29)
    at Module.parseItem (file:///home/user/Documents/yt-player/node_modules/youtubei.js/dist/src/parser/parser.js:384:28)
    at new LiveChatHeader (file:///home/user/Documents/yt-player/node_modules/youtubei.js/dist/src/parser/classes/LiveChatHeader.js:9:37)
    at Module.parseItem (file:///home/user/Documents/yt-player/node_modules/youtubei.js/dist/src/parser/parser.js:384:28)
    at new LiveChat (file:///home/user/Documents/yt-player/node_modules/youtubei.js/dist/src/parser/classes/LiveChat.js:8:30) {
  date: 2024-02-09T01:36:45.441Z,
  version: '9.0.2'
}

Expected behavior

Receive video information

Current behavior

Parsing of InnertubeError fails

Version

Edge

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.
@foltia foltia added the bug Something isn't working label Feb 9, 2024
@meghe2000
Copy link

image
I have the same problem.
const home = await yt.getHomeFeed();

console.log(home.videos);

Of course, sometimes this error appears and not always.

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

No branches or pull requests

3 participants