iBicha / yt2alt

A cli tool to import your profile from YouTube to an alternative platform
GNU Affero General Public License v3.0
26 stars 3 forks source link

[YOUTUBEJS][Parser]: InnertubeError: ChipBarView not found! #32

Closed Lcstyle closed 4 months ago

Lcstyle commented 4 months ago
yt2alt v0.4.6

? This tool will log into your YouTube account, read your data, and allow
you to import it to other platforms.
You will get to choose which data to import and where to export it.
Continue? yes

Go to https://www.google.com/device in your browser and enter code X-X-X to authenticate.
? Copy code to clipboard and open url in the browser now? no

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

  chips: ObservedArray<YTNodes.ChipView> | null;

  constructor(data: RawNode) {
    super();
    this.chips = Parser.parse(data.chips, true, YTNodes.ChipView);
  }
}

    at ERROR_HANDLER (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/parser.js:67:27)
    at createRuntimeClass (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/generator.js:322:5)
    at generateRuntimeClass (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/generator.js:374:21)
    at Module.parseItem (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/parser.js:365:17)
    at new RichGrid (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/classes/RichGrid.js:8:30)
    at Module.parseItem (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/parser.js:388:28)
    at new Tab (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/classes/Tab.js:13:31)
    at parseItem (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/parser.js:388:28)
    at Module.parse (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/parser.js:426:28)
    at new TwoColumnBrowseResults (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/classes/TwoColumnBrowseResults.js:6:28) {
  date: 2024-04-29T10:45:52.708Z,
  version: '9.3.0'
}
[YOUTUBEJS][Parser]: InnertubeError: ChipView 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 ChipView extends YTNode {
  static type = 'ChipView';

  text: string;
  display_type: string;
  endpoint: NavigationEndpoint;
  chip_entity_key: string;

  constructor(data: RawNode) {
    super();
    this.text = data.text;
    this.display_type = data.displayType;
    this.endpoint = new NavigationEndpoint(data.tapCommand);
    this.chip_entity_key = data.chipEntityKey;
  }
}

    at ERROR_HANDLER (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/parser.js:67:27)
    at createRuntimeClass (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/generator.js:322:5)
    at generateRuntimeClass (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/generator.js:374:21)
    at generateRuntimeClass (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/generator.js:377:9)
    at Module.parseItem (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/parser.js:365:17)
    at new RichGrid (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/classes/RichGrid.js:8:30)
    at Module.parseItem (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/parser.js:388:28)
    at new Tab (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/classes/Tab.js:13:31)
    at parseItem (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/parser.js:388:28)
    at Module.parse (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/youtubei.js/dist/src/parser/parser.js:426:28) {
  date: 2024-04-29T10:45:52.722Z,
  version: '9.3.0'
}

file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/@inquirer/checkbox/dist/esm/index.mjs:40
        const last = items.findLastIndex(isSelectable);
                           ^

TypeError: items.findLastIndex is not a function
    at file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/@inquirer/checkbox/dist/esm/index.mjs:40:28
    at file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/@inquirer/core/dist/esm/lib/use-memo.mjs:8:27
    at withPointer (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/@inquirer/core/dist/esm/lib/hook-engine.mjs:64:25)
    at useMemo (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/@inquirer/core/dist/esm/lib/use-memo.mjs:3:12)
    at file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/@inquirer/checkbox/dist/esm/index.mjs:38:20
    at workLoop (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/@inquirer/core/dist/esm/lib/create-prompt.mjs:66:42)
    at file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/@inquirer/core/dist/esm/lib/create-prompt.mjs:76:17
    at file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/@inquirer/core/dist/esm/lib/hook-engine.mjs:20:9
    at AsyncLocalStorage.run (node:async_hooks:330:14)
    at withHooks (file:///root/.npm/_npx/00e04e11bd4e38b3/node_modules/@inquirer/core/dist/esm/lib/hook-engine.mjs:19:24)
iBicha commented 4 months ago

Thanks, can you share the node/npm versions you have?

node --version
npm --version
Lcstyle commented 4 months ago

it appears that I was using an outdated version of npm and node - after updating, I was able to successfully use the tool. Although I did receive some error messages about playlists.

yt2alt v0.4.6

? This tool will log into your YouTube account, read your data, and allow
you to import it to other platforms.
You will get to choose which data to import and where to export it.
Continue? yes

Go to https://www.google.com/device in your browser and enter code X to authenticate.
? Copy code to clipboard and open url in the browser now? no

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

  chips: ObservedArray<YTNodes.ChipView> | null;

  constructor(data: RawNode) {
    super();
    this.chips = Parser.parse(data.chips, true, YTNodes.ChipView);
  }
}

    at ERROR_HANDLER (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:67:27)
    at createRuntimeClass (file:///root/node_modules/youtubei.js/dist/src/parser/generator.js:322:5)
    at generateRuntimeClass (file:///root/node_modules/youtubei.js/dist/src/parser/generator.js:374:21)
    at Module.parseItem (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:365:17)
    at new RichGrid (file:///root/node_modules/youtubei.js/dist/src/parser/classes/RichGrid.js:8:30)
    at Module.parseItem (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:388:28)
    at new Tab (file:///root/node_modules/youtubei.js/dist/src/parser/classes/Tab.js:13:31)
    at parseItem (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:388:28)
    at Module.parse (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:426:28)
    at new TwoColumnBrowseResults (file:///root/node_modules/youtubei.js/dist/src/parser/classes/TwoColumnBrowseResults.js:6:28) {
  date: 2024-04-29T14:37:55.955Z,
  version: '9.3.0'
}
[YOUTUBEJS][Parser]: InnertubeError: ChipView 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 ChipView extends YTNode {
  static type = 'ChipView';

  text: string;
  display_type: string;
  endpoint: NavigationEndpoint;
  chip_entity_key: string;

  constructor(data: RawNode) {
    super();
    this.text = data.text;
    this.display_type = data.displayType;
    this.endpoint = new NavigationEndpoint(data.tapCommand);
    this.chip_entity_key = data.chipEntityKey;
  }
}

    at ERROR_HANDLER (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:67:27)
    at createRuntimeClass (file:///root/node_modules/youtubei.js/dist/src/parser/generator.js:322:5)
    at generateRuntimeClass (file:///root/node_modules/youtubei.js/dist/src/parser/generator.js:374:21)
    at generateRuntimeClass (file:///root/node_modules/youtubei.js/dist/src/parser/generator.js:377:9)
    at Module.parseItem (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:365:17)
    at new RichGrid (file:///root/node_modules/youtubei.js/dist/src/parser/classes/RichGrid.js:8:30)
    at Module.parseItem (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:388:28)
    at new Tab (file:///root/node_modules/youtubei.js/dist/src/parser/classes/Tab.js:13:31)
    at parseItem (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:388:28)
    at Module.parse (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:426:28) {
  date: 2024-04-29T14:37:55.965Z,
  version: '9.3.0'
}
? Select the items to import from YouTube Subscriptions, Watch history, Liked videos, Watch later, Recommended videos, Favorites, Liked videos, Narcissist, Watch later

Reading Subscriptions...
TypeError: Assignment to constant variable.
    at YouTube.getChannels (file:///root/node_modules/yt2alt/src/youtube.js:93:22)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async YouTube.getProfile (file:///root/node_modules/yt2alt/src/youtube.js:18:30)
    at async file:///root/node_modules/yt2alt/src/cli.js:29:21
Reading Watch history...
Reading Liked videos...
[YOUTUBEJS][Parser]: ParsingError: Type mismatch, got FeedFilterChipBar expected CommentsHeader | ItemSectionHeader | ItemSectionTabbedHeader | SortFilterHeader.
    at ERROR_HANDLER (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:55:27)
    at Module.parseItem (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:369:25)
    at new ItemSection (file:///root/node_modules/youtubei.js/dist/src/parser/classes/ItemSection.js:11:30)
    at parseItem (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:388:28)
    at Module.parseArray (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:408:28)
    at new SectionList (file:///root/node_modules/youtubei.js/dist/src/parser/classes/SectionList.js:6:32)
    at Module.parseItem (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:388:28)
    at new Tab (file:///root/node_modules/youtubei.js/dist/src/parser/classes/Tab.js:13:31)
    at parseItem (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:388:28)
    at Module.parse (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:426:28) {
  info: {
    contents: [ [Object], [Object], [Object] ],
    trackingParams: 'XXXX',
    styleType: 'FEED_FILTER_CHIP_BAR_STYLE_TYPE_HASHTAG_LANDING_PAGE'
  },
  date: 2024-04-29T14:38:04.227Z,
  version: '9.3.0'
}
Reading Watch later...
Reading Recommended videos...
Reading Playlists...
Reading Playlist: Favorites
Reading Playlist: Liked videos
[YOUTUBEJS][Parser]: ParsingError: Type mismatch, got FeedFilterChipBar expected CommentsHeader | ItemSectionHeader | ItemSectionTabbedHeader | SortFilterHeader.
    at ERROR_HANDLER (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:55:27)
    at Module.parseItem (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:369:25)
    at new ItemSection (file:///root/node_modules/youtubei.js/dist/src/parser/classes/ItemSection.js:11:30)
    at parseItem (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:388:28)
    at Module.parseArray (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:408:28)
    at new SectionList (file:///root/node_modules/youtubei.js/dist/src/parser/classes/SectionList.js:6:32)
    at Module.parseItem (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:388:28)
    at new Tab (file:///root/node_modules/youtubei.js/dist/src/parser/classes/Tab.js:13:31)
    at parseItem (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:388:28)
    at Module.parse (file:///root/node_modules/youtubei.js/dist/src/parser/parser.js:426:28) {
  info: {
    contents: [ [Object], [Object], [Object] ],
    trackingParams: 'XXXX',
    styleType: 'FEED_FILTER_CHIP_BAR_STYLE_TYPE_HASHTAG_LANDING_PAGE'
  },
  date: 2024-04-29T14:38:06.239Z,
  version: '9.3.0'
}
Lcstyle commented 4 months ago

Thanks, can you share the node/npm versions you have?

node --version
npm --version
# npm -v
10.5.1
# node -v
v22.0.0
Lcstyle commented 4 months ago

issue resolved with 9.4.0

iBicha commented 4 months ago

@Lcstyle yt2alt v0.4.7 has been released, please let me know if you're still facing issues.