mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-17 03:22:15 +00:00
* feat(Player.ts): append `cver` to deciphered URLs * refactor(Actions.ts): remove redundant `getVideoInfo` function This is leftover code from previous versions. It had many problems and it is no longer required. * fix(Kids.ts): remove unneeded `await` keywords * dev: add more endpoints * chore: update deps * refactor: separate endpoints into files * dev: improve types * dev: add more endpoints * refactor: put clients in a separate directory inside `core` * chore: lint * refactor: move mixins and managers to separate folders * chore: fix tests * dev: add `CreateVideoEndpoint` * chore: clean up * chore: lint * chore: add some comments * chore: remove unnecessary test * dev: add `playlist/CreateEndpoint` * dev: add `playlist/DeleteEndpoint` * dev: add `browse/EditPlaylistEndpoint` * fix(parser): add a few checks to avoid parsing errors
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { YTNode } from '../helpers.js';
|
|
import type { RawNode } from '../index.js';
|
|
import Text from './misc/Text.js';
|
|
import Thumbnail from './misc/Thumbnail.js';
|
|
import NavigationEndpoint from './NavigationEndpoint.js';
|
|
|
|
export default class InfoPanelContent extends YTNode {
|
|
static type = 'InfoPanelContent';
|
|
|
|
title: Text;
|
|
source: Text;
|
|
paragraphs: Text[];
|
|
thumbnail: Thumbnail[];
|
|
source_endpoint: NavigationEndpoint;
|
|
truncate_paragraphs: boolean;
|
|
background: string;
|
|
inline_link_icon_type?: string;
|
|
|
|
constructor(data: RawNode) {
|
|
super();
|
|
this.title = new Text(data.title);
|
|
this.source = new Text(data.source);
|
|
this.paragraphs = data.paragraphs.map((p: RawNode) => new Text(p));
|
|
this.thumbnail = Thumbnail.fromResponse(data.thumbnail);
|
|
this.source_endpoint = new NavigationEndpoint(data.sourceEndpoint);
|
|
this.truncate_paragraphs = !!data.truncateParagraphs;
|
|
this.background = data.background;
|
|
|
|
if (Reflect.has(data, 'inlineLinkIcon') && Reflect.has(data.inlineLinkIcon, 'iconType')) {
|
|
this.inline_link_icon_type = data.inlineLinkIcon.iconType;
|
|
}
|
|
}
|
|
} |