mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-24 07:11:48 +00:00
fix(YouTube): fix warnings when retrieving members-only content (#341)
This commit is contained in:
21
src/parser/classes/PlayerLegacyDesktopYpcOffer.ts
Normal file
21
src/parser/classes/PlayerLegacyDesktopYpcOffer.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { YTNode } from '../helpers.js';
|
||||
import type { RawNode } from '../index.js';
|
||||
|
||||
class PlayerLegacyDesktopYpcOffer extends YTNode {
|
||||
static type = 'PlayerLegacyDesktopYpcOffer';
|
||||
|
||||
title: string;
|
||||
thumbnail: string;
|
||||
offer_description: string;
|
||||
offer_id: string;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.title = data.itemTitle;
|
||||
this.thumbnail = data.itemThumbnail;
|
||||
this.offer_description = data.offerDescription;
|
||||
this.offer_id = data.offerId;
|
||||
}
|
||||
}
|
||||
|
||||
export default PlayerLegacyDesktopYpcOffer;
|
||||
@@ -1,7 +1,9 @@
|
||||
import { YTNode } from '../helpers.js';
|
||||
import type { RawNode } from '../index.js';
|
||||
import type { ObservedArray } from '../helpers.js';
|
||||
import { YTNodes } from '../index.js';
|
||||
import Parser from '../index.js';
|
||||
import Text from './misc/Text.js';
|
||||
import { YTNode } from '../helpers.js';
|
||||
import Menu from './menus/Menu.js';
|
||||
|
||||
class VideoPrimaryInfo extends YTNode {
|
||||
static type = 'VideoPrimaryInfo';
|
||||
@@ -10,17 +12,21 @@ class VideoPrimaryInfo extends YTNode {
|
||||
super_title_link: Text;
|
||||
view_count: Text;
|
||||
short_view_count: Text;
|
||||
badges: ObservedArray<YTNodes.MetadataBadge>;
|
||||
published: Text;
|
||||
menu;
|
||||
relative_date: Text;
|
||||
menu: YTNodes.Menu | null;
|
||||
|
||||
constructor(data: any) {
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.title = new Text(data.title);
|
||||
this.super_title_link = new Text(data.superTitleLink);
|
||||
this.view_count = new Text(data.viewCount.videoViewCountRenderer.viewCount);
|
||||
this.short_view_count = new Text(data.viewCount.videoViewCountRenderer.shortViewCount);
|
||||
this.view_count = new Text(data.viewCount?.videoViewCountRenderer?.viewCount);
|
||||
this.short_view_count = new Text(data.viewCount?.videoViewCountRenderer?.shortViewCount);
|
||||
this.badges = Parser.parseArray(data.badges, YTNodes.MetadataBadge);
|
||||
this.published = new Text(data.dateText);
|
||||
this.menu = Parser.parseItem(data.videoActions, Menu);
|
||||
this.relative_date = new Text(data.relativeDateText);
|
||||
this.menu = Parser.parseItem(data.videoActions, YTNodes.Menu);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user