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

CompactMovie not found! #460

Closed
3 of 4 tasks
inad9300 opened this issue Jul 31, 2023 · 3 comments
Closed
3 of 4 tasks

CompactMovie not found! #460

inad9300 opened this issue Jul 31, 2023 · 3 comments
Labels
bug Something isn't working fixed

Comments

@inad9300
Copy link

inad9300 commented Jul 31, 2023

InnertubeError: CompactMovie 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 CompactMovie extends YTNode {
  static type = 'CompactMovie';

  video_id: string;
  thumbnail: Thumbnail[];
  title: Text;
  length_text: Text;
  endpoint: NavigationEndpoint;
  badges: ObservedArray<YTNodes.MetadataBadge> | null;
  menu: YTNodes.Menu | null;
  use_vertical_poster: boolean;
  top_metadata_items: {
    0: Text
  };
  thumbnail_overlays: ObservedArray<YTNodes.ThumbnailOverlayTimeStatus | YTNodes.ThumbnailOverlayToggleButton | YTNodes.ThumbnailOverlayNowPlaying> | null;
  author: Author;

  constructor(data: RawNode) {
    super();
    this.video_id = data.videoId;
    this.thumbnail = Thumbnail.fromResponse(data.thumbnail);
    this.title = new Text(data.title);
    this.length_text = new Text(data.lengthText);
    this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
    this.badges = Parser.parse(data.badges, true, [ YTNodes.MetadataBadge ]);
    this.menu = Parser.parseItem(data.menu, [ YTNodes.Menu ]);
    this.use_vertical_poster = data.useVerticalPoster;
    this.top_metadata_items = {
      0: new Text(data.topMetadataItems.0)
    };
    this.thumbnail_overlays = Parser.parse(data.thumbnailOverlays, true, [ YTNodes.ThumbnailOverlayTimeStatus, YTNodes.ThumbnailOverlayToggleButton, YTNodes.ThumbnailOverlayNowPlaying ]);
    this.author = new Author(data.shortBylineText, undefined);
  }
}
    at YTNodeGenerator._YTNodeGenerator_logNewClass (file:///.../node_modules/youtubei.js/dist/src/parser/generator.js:508:18)
    at YTNodeGenerator.createRuntimeClass (file:///.../node_modules/youtubei.js/dist/src/parser/generator.js:166:77)
    at YTNodeGenerator.generateRuntimeClass (file:///.../node_modules/youtubei.js/dist/src/parser/generator.js:231:30)
    at Parser.parseItem (file:///.../node_modules/youtubei.js/dist/src/parser/parser.js:225:106)
    at Parser.parseArray (file:///.../node_modules/youtubei.js/dist/src/parser/parser.js:249:37)
    at new TwoColumnWatchNextResults (file:///.../node_modules/youtubei.js/dist/src/parser/classes/TwoColumnWatchNextResults.js:15:41)
    at Parser.parseItem (file:///.../node_modules/youtubei.js/dist/src/parser/parser.js:234:32)
    at Parser.parse (file:///.../node_modules/youtubei.js/dist/src/parser/parser.js:278:43)
    at Parser.parseResponse (file:///.../node_modules/youtubei.js/dist/src/parser/parser.js:36:31)
    at new MediaInfo (file:///.../node_modules/youtubei.js/dist/src/core/mixins/MediaInfo.js:17:137) {
  date: 2023-07-31T17:33:31.623Z,
  version: '5.8.0'
}

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.
@inad9300 inad9300 added the bug Something isn't working label Jul 31, 2023
@LuanRT LuanRT added the good first issue Good for newcomers label Aug 1, 2023
@fabcotech
Copy link

fabcotech commented Aug 6, 2023

I have this bug as well, the following script reproduces it "youtubei.js": "^5.8.0", the error message also contains ProductListItem not found!, Something went wrong at ProductList! and others

const { Innertube } = require("youtubei.js");

const f = async () => {
  const it = await Innertube.create({
    /* setup - see above */
  });
  const videoInfo = await it.getInfo("ADjB99cgrrM");
};
f();

Edit: the bug seems to be absent in version "youtubei.js": "^4.3.0"

@LuanRT
Copy link
Owner

LuanRT commented Aug 6, 2023

These warnings are mostly harmless. It's just the parser telling you something's new/changed. Either way, I guess we should add a way to disable them.

@fabcotech
Copy link

Thanks, I got it now, the problem for me is that I am running this script as a child process, the child process must return/console.log stdout a string that is valid json . If youtubei.js console.logs stuffs, then my main process will be incapable of JSON.parsing the result from the child process ;) . Yes we need a way to disable them.

For now I can probably find a workaround in my code.

Wykerd added a commit that referenced this issue Aug 9, 2023
- Remove Parser class in favour of pure functions
- Merge duplicate classes `AppendContinuationItemsAction` into a single class
- Move continuation parsers into a seperate file
- Add better custom logging support to parser methods as per issue #460
LuanRT added a commit that referenced this issue Aug 18, 2023
* deps: update linkedom

* refactor!: remove YTNodeGenerator in favour of namespaced pure functions

BREAKING CHANGES:
- Removes `YTNodeGenerator` from `import('youtubei.js').Generator` and exposes its functions directly in `import('youtubei.js').Generator`

* refactor!: replace Parser class with pure functions

- Remove Parser class in favour of pure functions
- Merge duplicate classes `AppendContinuationItemsAction` into a single class
- Move continuation parsers into a seperate file
- Add better custom logging support to parser methods as per issue #460

* refactor!: replace Proto class with pure functions

* chore: update package-lock.json

* refactor!: replace FormatUtils with pure functions and JSX components

- Replace linkedom DASH manifest generation with a dependency free JSX implementation
- Remove FormatUtils class in favour of pure functions
- Remove DOMParser requirement
- Remove duplicate types

* refactor: implement changes from #462

* chore: lint

* fix: deno support

* fix: render valid xml document

* fix: wrong function call in DashUtils

* fix: typo in parser

Co-authored-by: LuanRT <[email protected]>

* refactor!: move streaming info logic into seperate function

This allows users to access the same data available in the dash manifest while also simplifying the manifest generation

* chore: lint

* refactor: readability improvements & fixes

Remove redundant getAudioTrackGroups
General readability improvements in StreamingInfo.ts
Share response object between `getBitrate` and `getMimeType` as to not make duplicate requests

* build: remove unnecessary step in deno build

Co-authored-by: absidue <[email protected]>

* refactor: move types to `types` directory

* docs: add back comments lost during refactor

* chore: lint

---------

Co-authored-by: LuanRT <[email protected]>
Co-authored-by: absidue <[email protected]>
@LuanRT LuanRT added fixed and removed good first issue Good for newcomers labels Aug 28, 2023
@LuanRT LuanRT closed this as completed Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

3 participants