LuanRT / YouTube.js

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

10.4.0 ShortsLockupView not found! #743

Closed SohelKabir closed 3 weeks ago

SohelKabir commented 1 month ago

Steps to reproduce

Install latest version and fetch shorts videos

const channel = await ytInstance.getChannel(channelId);
const shorts = await channel.getShorts();

Failure Logs

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

  entity_id: string;
  accessibility_text: string;
  thumbnail: {
    sources: {
      url: string,
      width: number,
      height: number
    }[]
  };
  on_tap: {
    innertube_command: NavigationEndpoint
  };
  menu_on_tap: {
    innertube_command: NavigationEndpoint
  };
  index_in_collection: number;
  menu_on_tap_a11y_label: string;
  overlay_metadata: {
    primary_text: {
      content: string
    },
    secondary_text: {
      content: string
    }
  };
  logging_directives: {
    tracking_params: string,
    visibility: {
      types: string
    },
    enable_displaylogger_experiment: boolean
  };

  constructor(data: RawNode) {
    super();
    this.entity_id = data.entityId;
    this.accessibility_text = data.accessibilityText;
    this.thumbnail = {
      sources: data.thumbnail.sources.map((item: any) => ({
        url: item.url,
        width: item.width,
        height: item.height
      }))
    };
    this.on_tap = {
      innertube_command: new NavigationEndpoint(data.onTap.innertubeCommand)
    };
    this.menu_on_tap = {
      innertube_command: new NavigationEndpoint(data.menuOnTap.innertubeCommand)
    };
    this.index_in_collection = data.indexInCollection;
    this.menu_on_tap_a11y_label = data.menuOnTapA11yLabel;
    this.overlay_metadata = {
      primary_text: {
        content: data.overlayMetadata.primaryText.content
      },
      secondary_text: {
        content: data.overlayMetadata.secondaryText.content
      }
    };
    this.logging_directives = {
      tracking_params: data.loggingDirectives.trackingParams,
      visibility: {
        types: data.loggingDirectives.visibility.types
      },
      enable_displaylogger_experiment: data.loggingDirectives.enableDisplayloggerExperiment
    };
  }
}

    at ERROR_HANDLER (/Volumes/Office/AlgeSoft/nexlev-extensions/nexlev-extension-backend/node_modules/.pnpm/youtubei.js@10.4.0/node_modules/youtubei.js/src/parser/parser.ts:132:9)
    at createRuntimeClass (/Volumes/Office/AlgeSoft/nexlev-extensions/nexlev-extension-backend/node_modules/.pnpm/youtubei.js@10.4.0/node_modules/youtubei.js/src/parser/generator.ts:409:3)
    at generateRuntimeClass (/Volumes/Office/AlgeSoft/nexlev-extensions/nexlev-extension-backend/node_modules/.pnpm/youtubei.js@10.4.0/node_modules/youtubei.js/src/parser/generator.ts:476:19)
    at parseItem (/Volumes/Office/AlgeSoft/nexlev-extensions/nexlev-extension-backend/node_modules/.pnpm/youtubei.js@10.4.0/node_modules/youtubei.js/src/parser/parser.ts:526:9)
    at Object.parseArray (/Volumes/Office/AlgeSoft/nexlev-extensions/nexlev-extension-backend/node_modules/.pnpm/youtubei.js@10.4.0/node_modules/youtubei.js/src/parser/parser.ts:581:22)
    at ReelShelf (/Volumes/Office/AlgeSoft/nexlev-extensions/nexlev-extension-backend/node_modules/.pnpm/youtubei.js@10.4.0/node_modules/youtubei.js/src/parser/classes/ReelShelf.ts:16:25)
    at parseItem (/Volumes/Office/AlgeSoft/nexlev-extensions/nexlev-extension-backend/node_modules/.pnpm/youtubei.js@10.4.0/node_modules/youtubei.js/src/parser/parser.ts:550:22)
    at Object.parseArray (/Volumes/Office/AlgeSoft/nexlev-extensions/nexlev-extension-backend/node_modules/.pnpm/youtubei.js@10.4.0/node_modules/youtubei.js/src/parser/parser.ts:581:22)
    at ItemSection (/Volumes/Office/AlgeSoft/nexlev-extensions/nexlev-extension-backend/node_modules/.pnpm/youtubei.js@10.4.0/node_modules/youtubei.js/src/parser/classes/ItemSection.ts:19:28)
    at parseItem (/Volumes/Office/AlgeSoft/nexlev-extensions/nexlev-extension-backend/node_modules/.pnpm/youtubei.js@10.4.0/node_modules/youtubei.js/src/parser/parser.ts:550:22) {
  date: 2024-09-02T14:24:35.343Z,
  version: '10.4.0'
}

Expected behavior

shorts videos

Current behavior

empty array

Version

Default

Anything else?

No response

Checklist

whiskeycola commented 1 month ago

Problem is also observed with shorts [YOUTUBEJS][Parser]: InnertubeError: BadgeView 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/u pdating-the-parser.md or report it at https://github.com/LuanRT/YouTube.js/issues! Introspected and JIT generated this class in the meantime: class BadgeView extends YTNode { static type = 'BadgeView'; ...

[YOUTUBEJS][Parser]: ShortsLockupView changed! The following keys where altered: badge The class has changed to: class ShortsLockupView extends YTNode { static type = 'ShortsLockupView'; ...

hextor1 commented 4 weeks ago

I am also facing these issue last 1 month I don't know how to solve this any one can tell ??

hextor1 commented 4 weeks ago

PLease share the modified code with me @absidue

absidue commented 4 weeks ago

@hextor1 You already commented on the pull request linked to this issue, so just take it from there and create a custom build of YouTube.js for yourself if you are too impatient to wait for it to be reviewed, merged and released.

hextor1 commented 4 weeks ago

@absidue i am not a devleoper can you tell me how much time to released new version?? i daily update this youtubei.js but still showing an message

absidue commented 4 weeks ago

@hextor1 Unless you are actually missing information that you need, just ignore the message, you can also turn off logging in YouTube.js if you don't want to see warnings.

hextor1 commented 4 weeks ago

Can you join me on google meet and tell me which options I need to turn off I am too much irritating from this message @absidue

hextor1 commented 4 weeks ago

@absidue Hello sir can you help me?? i am waiting for your response?? Basicallly just tell me the file location where I will turn off aor comment the log?

retrouser955 commented 4 weeks ago

@hextor1

import { Log } from 'youtubei.js';
Log.setLevel(Log.Level.NONE);

Also please be patient as this is an open sourced project.

sgebr01 commented 4 weeks ago

@hextor1 It's probably best to do it wherever you are running YouTubei.js and have created your InnerTube Instance. Like this

import { Innertube, Log } from 'youtubei.js';

Innertube.create().then((yt) => {
     Log.setLevel(Log.Level.NONE);
     // Rest of your YouTube.js code here
})
jason-hwang commented 3 weeks ago

Hi guys, Are there any updates?

const channel = await ytInstance.getChannel(channelId);
const shorts = await channel.getShorts();

// shorts is empty
hextor1 commented 3 weeks ago

Hi guys, Are there any updates?

const channel = await ytInstance.getChannel(channelId);
const shorts = await channel.getShorts();

// shorts is empty

Still waiting for update @jason-hwang

absidue commented 3 weeks ago

@jason-hwang Just be patient, YouTube.js is a project maintained by volunteers in their spare time. If you don't want to wait you can try the code in my pull request and create a custom build of YouTube.js for yourself, otherwise just be patient.

hextor1 commented 3 weeks ago

@hextor1 It's probably best to do it wherever you are running YouTubei.js and have created your InnerTube Instance. Like this

import { Innertube, Log } from 'youtubei.js';

Innertube.create().then((yt) => {
     Log.setLevel(Log.Level.NONE);
     // Rest of your YouTube.js code here
})

@sgebr01 can you join me on google meet and then let me know where to do this??

jason-hwang commented 3 weeks ago

Still waiting for update @jason-hwang

Thank you for your response. I didn't mean to be rude and ask for a version update, I just found this issue thread for the first time today and was curious about the progress. I appreciate your efforts 🙏

absidue commented 3 weeks ago

@hextor1 Please stop spamming your messages all over this repo, either read the messages that people have sent to you and do what they say (people told you exactly how to turn off the log message) or be patient and wait for the pull request to be tested, reviewed, merged and released.

hextor1 commented 3 weeks ago

@hextor1 Please stop spamming your messages all over this repo, either read the messages that people have sent to you and do what they say (people told you exactly how to turn off the log message) or be patient and wait for the pull request to be tested, reviewed, merged and released.

@absidue OK and thank you so much