LuanRT / YouTube.js

A JavaScript client for YouTube's private API, known as InnerTube.
https://ytjs.dev
MIT License
3.62k stars 232 forks source link

10.0.0 [YOUTUBEJS][Parser]: InnertubeError: MiniGameCardView not found! #685

Closed iBicha closed 4 months ago

iBicha commented 4 months ago

Steps to reproduce

Getting home feed

const feed = await innertube.getHomeFeed();

Failure Logs

[YOUTUBEJS][Parser]: InnertubeError: MiniGameCardView 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 MiniGameCardView extends YTNode {
  static type = 'MiniGameCardView';

  image: {
    sources: {
      url: string,
      width: number,
      height: number
    }[]
  };
  title: string;
  genre: string;
  on_tap: {
    innertube_command: NavigationEndpoint
  };
  accessibility_text: string;
  overflow_button: YTNodes.ButtonView | null;
  layout: string;
  color_palette: {
    text_primary_color: number,
    section_two_color: number,
    section_four_color: number
  };
  action_button: YTNodes.ButtonView | null;
  style: string;
  inline_playback_experiments: {
    enable_simplified_android_ui: boolean,
    disable_cinematic_container: boolean,
    enable_squared_thumbnails: boolean
  };
  index_in_shelf: number;
  logging_directives: {
    tracking_params: string,
    visibility: {
      types: string
    },
    gestures: {
      types: string
    },
    enable_displaylogger_experiment: boolean
  };

  constructor(data: RawNode) {
    super();
    this.image = {
      sources: data.image.sources.map((item: any) => ({
        url: item.url,
        width: item.width,
        height: item.height
      }))
    };
    this.title = data.title;
    this.genre = data.genre;
    this.on_tap = {
      innertube_command: new NavigationEndpoint(data.onTap.innertubeCommand)
    };
    this.accessibility_text = data.accessibilityText;
    this.overflow_button = Parser.parseItem(data.overflowButton, YTNodes.ButtonView);
    this.layout = data.layout;
    this.color_palette = {
      text_primary_color: data.colorPalette.textPrimaryColor,
      section_two_color: data.colorPalette.sectionTwoColor,
      section_four_color: data.colorPalette.sectionFourColor
    };
    this.action_button = Parser.parseItem(data.actionButton, YTNodes.ButtonView);
    this.style = data.style;
    this.inline_playback_experiments = {
      enable_simplified_android_ui: data.inlinePlaybackExperiments.enableSimplifiedAndroidUi,
      disable_cinematic_container: data.inlinePlaybackExperiments.disableCinematicContainer,
      enable_squared_thumbnails: data.inlinePlaybackExperiments.enableSquaredThumbnails
    };
    this.index_in_shelf = data.indexInShelf;
    this.logging_directives = {
      tracking_params: data.loggingDirectives.trackingParams,
      visibility: {
        types: data.loggingDirectives.visibility.types
      },
      gestures: {
        types: data.loggingDirectives.gestures.types
      },
      enable_displaylogger_experiment: data.loggingDirectives.enableDisplayloggerExperiment
    };
  }
}

    at ERROR_HANDLER (file:///Users/path/to/yt2alt/node_modules/youtubei.js/dist/src/parser/parser.js:67:27)
    at createRuntimeClass (file:///Users/path/to/yt2alt/node_modules/youtubei.js/dist/src/parser/generator.js:322:5)
    at generateRuntimeClass (file:///Users/path/to/yt2alt/node_modules/youtubei.js/dist/src/parser/generator.js:374:21)
    at Module.parseItem (file:///Users/path/to/yt2alt/node_modules/youtubei.js/dist/src/parser/parser.js:365:17)
    at new RichItem (file:///Users/path/to/yt2alt/node_modules/youtubei.js/dist/src/parser/classes/RichItem.js:6:31)
    at parseItem (file:///Users/path/to/yt2alt/node_modules/youtubei.js/dist/src/parser/parser.js:388:28)
    at Module.parseArray (file:///Users/path/to/yt2alt/node_modules/youtubei.js/dist/src/parser/parser.js:408:28)
    at new RichShelf (file:///Users/path/to/yt2alt/node_modules/youtubei.js/dist/src/parser/classes/RichShelf.js:9:32)
    at Module.parseItem (file:///Users/path/to/yt2alt/node_modules/youtubei.js/dist/src/parser/parser.js:388:28)
    at new RichSection (file:///Users/path/to/yt2alt/node_modules/youtubei.js/dist/src/parser/classes/RichSection.js:6:31) {
  date: 2024-07-10T21:47:35.950Z,
  version: '10.0.0'
}

Expected behavior

No error

Current behavior

Error

Version

Default

Anything else?

No response

Checklist

iBicha commented 4 months ago

I guess this is the view

Screen Shot 2024-07-13 at 11 23 19 AM
LuanRT commented 4 months ago

Maybe we should just add it to the list of ignored nodes? I don't see anyone wanting to get any info from this.

iBicha commented 4 months ago

Maybe we should just add it to the list of ignored nodes? I don't see anyone wanting to get any info from this.

Yeah unlikely that anyone cares about it