mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-26 16:18:51 +00:00
chore: v5.0.0 release
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { timeToSeconds } from '../../utils/Utils.ts';
|
||||
import { YTNode } from '../helpers.ts';
|
||||
import Parser, { RawNode } from '../index.ts';
|
||||
import { YTNode, type ObservedArray, type SuperParsedResult } from '../helpers.ts';
|
||||
import Parser, { type RawNode } from '../index.ts';
|
||||
import Menu from './menus/Menu.ts';
|
||||
import MetadataBadge from './MetadataBadge.ts';
|
||||
import Author from './misc/Author.ts';
|
||||
@@ -8,12 +8,12 @@ import Text from './misc/Text.ts';
|
||||
import Thumbnail from './misc/Thumbnail.ts';
|
||||
import NavigationEndpoint from './NavigationEndpoint.ts';
|
||||
|
||||
class CompactVideo extends YTNode {
|
||||
export default class CompactVideo extends YTNode {
|
||||
static type = 'CompactVideo';
|
||||
|
||||
id: string;
|
||||
thumbnails: Thumbnail[];
|
||||
rich_thumbnail;
|
||||
rich_thumbnail?: SuperParsedResult<YTNode>;
|
||||
title: Text;
|
||||
author: Author;
|
||||
view_count: Text;
|
||||
@@ -26,7 +26,7 @@ class CompactVideo extends YTNode {
|
||||
seconds: number;
|
||||
};
|
||||
|
||||
thumbnail_overlays;
|
||||
thumbnail_overlays: ObservedArray<YTNode>;
|
||||
endpoint: NavigationEndpoint;
|
||||
menu: Menu | null;
|
||||
|
||||
@@ -34,7 +34,11 @@ class CompactVideo extends YTNode {
|
||||
super();
|
||||
this.id = data.videoId;
|
||||
this.thumbnails = Thumbnail.fromResponse(data.thumbnail) || null;
|
||||
this.rich_thumbnail = data.richThumbnail && Parser.parse(data.richThumbnail);
|
||||
|
||||
if (Reflect.has(data, 'richThumbnail')) {
|
||||
this.rich_thumbnail = Parser.parse(data.richThumbnail);
|
||||
}
|
||||
|
||||
this.title = new Text(data.title);
|
||||
this.author = new Author(data.longBylineText, data.ownerBadges, data.channelThumbnail);
|
||||
this.view_count = new Text(data.viewCountText);
|
||||
@@ -74,6 +78,4 @@ class CompactVideo extends YTNode {
|
||||
get is_premiere(): boolean {
|
||||
return this.badges.some((badge) => badge.style === 'PREMIERE');
|
||||
}
|
||||
}
|
||||
|
||||
export default CompactVideo;
|
||||
}
|
||||
Reference in New Issue
Block a user