LuanRT / YouTube.js

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

6.4.1 – error: Clarification not found! #520

Closed inad9300 closed 8 months ago

inad9300 commented 1 year ago
16 | }
17 | _a = Platform;
18 | _Platform_shim = { value: void 0 };
19 | export class InnertubeError extends Error {
20 |     constructor(message, info) {
21 |         super(message);
            ^
error: Clarification 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 Clarification extends YTNode {
  static type = 'Clarification';

  text: Text;
  endpoint: NavigationEndpoint;
  menu: YTNodes.Menu | null;
  source: Text;
  source_icon: {
    icon_type: string
  };
  style: string;
  content_title: Text;
  endpoint: NavigationEndpoint;
  secondary_icon: {
    icon_type: string
  };
  action_button: YTNodes.Button | null;
  background: string;
  secondary_source: Text;
  cta_has_bottom_section: boolean;
  logging_directives: {
    tracking_params: string,
    visibility: {
      types: string
    },
    gestures: {
      types: string
    },
    enable_displaylogger_experiment: boolean
  };

  constructor(data: RawNode) {
    super();
    this.text = new Text(data.text);
    this.endpoint = new NavigationEndpoint(data.endpoint);
    this.menu = Parser.parseItem(data.menu, [ YTNodes.Menu ]);
    this.source = new Text(data.source);
    this.source_icon = {
      icon_type: data.sourceIcon.iconType
    };
    this.style = data.style;
    this.content_title = new Text(data.contentTitle);
    this.endpoint = new NavigationEndpoint(data.secondaryEndpoint);
    this.secondary_icon = {
      icon_type: data.secondaryIcon.iconType
    };
    this.action_button = Parser.parseItem(data.actionButton, [ YTNodes.Button ]);
    this.background = data.background;
    this.secondary_source = new Text(data.secondarySource);
    this.cta_has_bottom_section = data.ctaHasBottomSection;
    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 new InnertubeError (.../node_modules/youtubei.js/dist/src/utils/Utils.js:21:8)
      at ERROR_HANDLER (.../node_modules/youtubei.js/dist/src/parser/parser.js:64:25)
      at createRuntimeClass (.../node_modules/youtubei.js/dist/src/parser/generator.js:246:4)
      at generateRuntimeClass (.../node_modules/youtubei.js/dist/src/parser/generator.js:298:20)
      at parseItem (.../node_modules/youtubei.js/dist/src/parser/parser.js:328:16)
      at parseArray (.../node_modules/youtubei.js/dist/src/parser/parser.js:371:27)
      at new ItemSection (.../node_modules/youtubei.js/dist/src/parser/classes/ItemSection.js:11:24)
      at parseItem (.../node_modules/youtubei.js/dist/src/parser/parser.js:351:27)
      at parseArray (.../node_modules/youtubei.js/dist/src/parser/parser.js:371:27)
      at new TwoColumnWatchNextResults (.../node_modules/youtubei.js/dist/src/parser/classes/TwoColumnWatchNextResults.js:14:23)
inad9300 commented 1 year ago

And some more:

16 | }
17 | _a = Platform;
18 | _Platform_shim = { value: void 0 };
19 | export class InnertubeError extends Error {
20 |     constructor(message, info) {
21 |         super(message);
            ^
error: ErrorCorrectionsSection 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 ErrorCorrectionsSection extends YTNode {
  static type = 'ErrorCorrectionsSection';

  title: Text;
  view_all_button: YTNodes.Button | null;
  items: ObservedArray<YTNodes.ErrorCorrectionsSectionItem> | null;

  constructor(data: RawNode) {
    super();
    this.title = new Text(data.title);
    this.view_all_button = Parser.parseItem(data.viewAllButton, [ YTNodes.Button ]);
    this.items = Parser.parse(data.items, true, [ YTNodes.ErrorCorrectionsSectionItem ]);
  }
}

      at new InnertubeError (.../node_modules/youtubei.js/dist/src/utils/Utils.js:21:8)
      at ERROR_HANDLER (.../node_modules/youtubei.js/dist/src/parser/parser.js:64:25)
      at createRuntimeClass (.../node_modules/youtubei.js/dist/src/parser/generator.js:246:4)
      at generateRuntimeClass (.../node_modules/youtubei.js/dist/src/parser/generator.js:298:20)
      at parseItem (.../node_modules/youtubei.js/dist/src/parser/parser.js:328:16)
      at parseArray (.../node_modules/youtubei.js/dist/src/parser/parser.js:371:27)
      at new StructuredDescriptionContent (.../node_modules/youtubei.js/dist/src/parser/classes/StructuredDescriptionContent.js:13:21)
      at parseItem (.../node_modules/youtubei.js/dist/src/parser/parser.js:351:27)
      at new EngagementPanelSectionList (.../node_modules/youtubei.js/dist/src/parser/classes/EngagementPanelSectionList.js:13:23)
      at parseItem (.../node_modules/youtubei.js/dist/src/parser/parser.js:351:27)

16 | }
17 | _a = Platform;
18 | _Platform_shim = { value: void 0 };
19 | export class InnertubeError extends Error {
20 |     constructor(message, info) {
21 |         super(message);
            ^
error: ErrorCorrectionsSectionItem 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 ErrorCorrectionsSectionItem extends YTNode {
  static type = 'ErrorCorrectionsSectionItem';

  thumbnail: Thumbnail[];
  time_label: Text;
  correction_text: Text;
  on_tap: {
    click_tracking_params: string,
    command_metadata: {
      web_command_metadata: {
        url: string,
        web_page_type: string,
        root_ve: number
      }
    },
    watch_endpoint: NavigationEndpoint
  };

  constructor(data: RawNode) {
    super();
    this.thumbnail = Thumbnail.fromResponse(data.thumbnail);
    this.time_label = new Text(data.timeLabel);
    this.correction_text = new Text(data.correctionText);
    this.on_tap = {
      click_tracking_params: data.onTap.clickTrackingParams,
      command_metadata: {
        web_command_metadata: {
          url: data.onTap.commandMetadata.webCommandMetadata.url,
          web_page_type: data.onTap.commandMetadata.webCommandMetadata.webPageType,
          root_ve: data.onTap.commandMetadata.webCommandMetadata.rootVe
        }
      },
      watch_endpoint: new NavigationEndpoint(data.onTap.watchEndpoint)
    };
  }
}

      at new InnertubeError (.../node_modules/youtubei.js/dist/src/utils/Utils.js:21:8)
      at ERROR_HANDLER (.../node_modules/youtubei.js/dist/src/parser/parser.js:64:25)
      at createRuntimeClass (.../node_modules/youtubei.js/dist/src/parser/generator.js:246:4)
      at generateRuntimeClass (.../node_modules/youtubei.js/dist/src/parser/generator.js:298:20)
      at generateRuntimeClass (.../node_modules/youtubei.js/dist/src/parser/generator.js:301:8)
      at parseItem (.../node_modules/youtubei.js/dist/src/parser/parser.js:328:16)
      at parseArray (.../node_modules/youtubei.js/dist/src/parser/parser.js:371:27)
      at new StructuredDescriptionContent (.../node_modules/youtubei.js/dist/src/parser/classes/StructuredDescriptionContent.js:13:21)
      at parseItem (.../node_modules/youtubei.js/dist/src/parser/parser.js:351:27)
      at new EngagementPanelSectionList (.../node_modules/youtubei.js/dist/src/parser/classes/EngagementPanelSectionList.js:13:23)

16 | }
17 | _a = Platform;
18 | _Platform_shim = { value: void 0 };
19 | export class InnertubeError extends Error {
20 |     constructor(message, info) {
21 |         super(message);
            ^
error: Type mismatch, got ErrorCorrectionsSection expected VideoDescriptionHeader | ExpandableVideoDescriptionBody | VideoDescriptionMusicSection | VideoDescriptionInfocardsSection | VideoDescriptionCourseSection | VideoDescriptionTranscriptSection | VideoDescriptionTranscriptSection | HorizontalCardList.
 info: {
  "title": {
    "runs": [
      {
        "text": "Corrections"
      }
    ]
  },
  "viewAllButton": {
    "buttonRenderer": {
      "style": "STYLE_BLUE_TEXT",
      "size": "SIZE_DEFAULT",
      "isDisabled": false,
      "text": {
        "runs": [
          {
            "text": "View all"
          }
        ]
      },
      "trackingParams": "CC4Q8FsiEwjdnf6h4OOBAxWO2kkHHXeKCYk=",
      "command": {
        "clickTrackingParams": "CC4Q8FsiEwjdnf6h4OOBAxWO2kkHHXeKCYk=",
        "changeEngagementPanelVisibilityAction": {
          "targetId": "engagement-panel-error-corrections",
          "visibility": "ENGAGEMENT_PANEL_VISIBILITY_EXPANDED"
        }
      }
    }
  },
  "items": [
    {
      "errorCorrectionsSectionItemRenderer": {
        "thumbnail": {
          "thumbnails": [
            {
              "url": "https://yt3.ggpht.com/ytc/APkrFKZlwcULHR7UdumHCRSJwLH9cKr3G4H-a2PwSAwwj1U=s48-c-k-c0x00ffffff-no-rj",
              "width": 48,
              "height": 48
            }
          ]
        },
        "timeLabel": {
          "simpleText": "0:10"
        },
        "correctionText": {
          "simpleText": "IMPORTANT NOTE: Though the observational data does appear rife ( with reverse causation, a new study ( published interventional data in mice and in vitro on 2/27/23 that suggests erythritol may indeed be harmful, and so I urge everyone to stop consuming it until we know more."
        },
        "onTap": {
          "clickTrackingParams": "CC0Q3aAHGAAiEwjdnf6h4OOBAxWO2kkHHXeKCYk=",
          "commandMetadata": {
            "webCommandMetadata": {
              "url": "/watch?v=pJHMDAAwjJE&t=10s",
              "webPageType": "WEB_PAGE_TYPE_WATCH",
              "rootVe": 3832
            }
          },
          "watchEndpoint": {
            "videoId": "pJHMDAAwjJE",
            "continuePlayback": true,
            "startTimeSeconds": 10,
            "watchEndpointSupportedOnesieConfig": {
              "html5PlaybackOnesieConfig": {
                "commonConfig": {
                  "url": "https://rr1---sn-5ngj5cax-8bvl.googlevideo.com/initplayback?source=youtube&oeis=1&c=WEB&oad=3200&ovd=3200&oaad=11000&oavd=11000&ocs=700&oewis=1&oputc=1&ofpcc=1&beids=24350018&msp=1&odepv=1&id=a491cc0c00308c91&ip=213.60.193.126&osts=10&initcwndbps=1556250&mt=1696675029&oweuc="
                }
              }
            }
          }
        },
        "trackingParams": "CC0Q3aAHGAAiEwjdnf6h4OOBAxWO2kkHHXeKCYk=",
        "accessibility": {
          "accessibilityData": {
            "label": "At 10 seconds into the video, IMPORTANT NOTE: Though the observational data does appear rife ( with reverse causation, a new study ( published interventional data in mice and in vitro on 2/27/23 that suggests erythritol may indeed be harmful, and so I urge everyone to stop consuming it until we know more."
          }
        }
      }
    }
  ],
  "trackingParams": "CCwQ4qUHGAIiEwjdnf6h4OOBAxWO2kkHHXeKCYk="
}

      at new InnertubeError (.../node_modules/youtubei.js/dist/src/utils/Utils.js:21:8)
      at new ParsingError (:1:32)
      at ERROR_HANDLER (.../node_modules/youtubei.js/dist/src/parser/parser.js:52:25)
      at parseItem (.../node_modules/youtubei.js/dist/src/parser/parser.js:332:24)
      at parseArray (.../node_modules/youtubei.js/dist/src/parser/parser.js:371:27)
      at new StructuredDescriptionContent (.../node_modules/youtubei.js/dist/src/parser/classes/StructuredDescriptionContent.js:13:21)
      at parseItem (.../node_modules/youtubei.js/dist/src/parser/parser.js:351:27)
      at new EngagementPanelSectionList (.../node_modules/youtubei.js/dist/src/parser/classes/EngagementPanelSectionList.js:13:23)
      at parseItem (.../node_modules/youtubei.js/dist/src/parser/parser.js:351:27)
      at parseArray (.../node_modules/youtubei.js/dist/src/parser/parser.js:371:27)
github-actions[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.