This commit is contained in:
Luan
2024-10-29 12:05:33 -03:00
6 changed files with 18 additions and 6 deletions

View File

@@ -1,5 +1,12 @@
# Changelog
## [11.0.1](https://github.com/LuanRT/YouTube.js/compare/v11.0.0...v11.0.1) (2024-10-28)
### Bug Fixes
* **VideoInfo:** Fix like count being undefined ([#787](https://github.com/LuanRT/YouTube.js/issues/787)) ([182bf42](https://github.com/LuanRT/YouTube.js/commit/182bf42d3cdf5148c667e958cd4d4eaa091a6d68))
## [11.0.0](https://github.com/LuanRT/YouTube.js/compare/v10.5.0...v11.0.0) (2024-10-28)

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "youtubei.js",
"version": "11.0.0",
"version": "11.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "youtubei.js",
"version": "11.0.0",
"version": "11.0.1",
"funding": [
"https://github.com/sponsors/LuanRT"
],

View File

@@ -1,6 +1,6 @@
{
"name": "youtubei.js",
"version": "11.0.0",
"version": "11.0.1",
"description": "A JavaScript client for YouTube's private API, known as InnerTube.",
"type": "module",
"types": "./dist/src/platform/lib.d.ts",

View File

@@ -17,6 +17,7 @@ export default class AccountItem extends YTNode {
has_channel: boolean;
endpoint: NavigationEndpoint;
account_byline: Text;
channel_handle: Text;
constructor(data: RawNode) {
super();
@@ -27,5 +28,6 @@ export default class AccountItem extends YTNode {
this.has_channel = !!data.hasChannel;
this.endpoint = new NavigationEndpoint(data.serviceEndpoint);
this.account_byline = new Text(data.accountByline);
this.channel_handle = new Text(data.channelHandle);
}
}

View File

@@ -3,18 +3,20 @@ import type { ObservedArray } from '../../helpers.js';
import { YTNode } from '../../helpers.js';
import type { RawNode } from '../../index.js';
import Button from '../Button.js';
import ButtonView from '../ButtonView.js';
import SegmentedLikeDislikeButtonView from '../SegmentedLikeDislikeButtonView.js';
export default class Menu extends YTNode {
static type = 'Menu';
items: ObservedArray<YTNode>;
top_level_buttons: ObservedArray<Button>;
top_level_buttons: ObservedArray<Button | ButtonView | SegmentedLikeDislikeButtonView>;
label?: string;
constructor(data: RawNode) {
super();
this.items = Parser.parseArray(data.items);
this.top_level_buttons = Parser.parseArray(data.topLevelButtons, Button);
this.top_level_buttons = Parser.parseArray(data.topLevelButtons, [ Button, ButtonView, SegmentedLikeDislikeButtonView ]);
if (Reflect.has(data, 'accessibility') && Reflect.has(data.accessibility, 'accessibilityData')) {
this.label = data.accessibility.accessibilityData.label;

View File

@@ -1,6 +1,7 @@
import Feed from '../../core/mixins/Feed.js';
import ItemSection from '../classes/ItemSection.js';
import BrowseFeedActions from '../classes/BrowseFeedActions.js';
import Button from '../classes/Button.js';
import type { Actions, ApiResponse } from '../../core/index.js';
import type { IBrowseResponse } from '../types/index.js';
@@ -37,7 +38,7 @@ export default class History extends Feed<IBrowseResponse> {
for (const content of section.contents) {
const video = content as Video;
if (video.id === video_id && video.menu) {
feedbackToken = video.menu.top_level_buttons[0].endpoint.payload.feedbackToken;
feedbackToken = video.menu.top_level_buttons[0].as(Button).endpoint.payload.feedbackToken;
break;
}
}