mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-22 14:08:06 +00:00
fix: incorrect node parser implementations (#428)
These were causing some issues in v5.2.0.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { type ObservedArray, YTNode } from '../helpers.js';
|
||||
import { YTNode, type ObservedArray } from '../helpers.js';
|
||||
import Parser, { type RawNode } from '../index.js';
|
||||
import { Text } from '../misc.js';
|
||||
import type { Thumbnail } from '../misc.js';
|
||||
import { Text, Thumbnail } from '../misc.js';
|
||||
import Factoid from './Factoid.js';
|
||||
import NavigationEndpoint from './NavigationEndpoint.js';
|
||||
|
||||
@@ -10,7 +9,7 @@ export default class VideoDescriptionHeader extends YTNode {
|
||||
|
||||
channel: Text;
|
||||
channel_navigation_endpoint?: NavigationEndpoint;
|
||||
channel_thumbnails: String[];
|
||||
channel_thumbnail: Thumbnail[];
|
||||
factoids: ObservedArray<Factoid>;
|
||||
publish_date: Text;
|
||||
title: Text;
|
||||
@@ -20,8 +19,8 @@ export default class VideoDescriptionHeader extends YTNode {
|
||||
super();
|
||||
this.title = new Text(data.title);
|
||||
this.channel = new Text(data.channel);
|
||||
this.channel_navigation_endpoint = Parser.parseItem(data.channelNavigationEndpoint, NavigationEndpoint) || undefined;
|
||||
this.channel_thumbnails = data.channelThumbnail.thumbnails.map((thumbnail: Thumbnail) => thumbnail.url);
|
||||
this.channel_navigation_endpoint = new NavigationEndpoint(data.channelNavigationEndpoint);
|
||||
this.channel_thumbnail = Thumbnail.fromResponse(data.channelThumbnail);
|
||||
this.publish_date = new Text(data.publishDate);
|
||||
this.views = new Text(data.views);
|
||||
this.factoids = Parser.parseArray(data.factoid, Factoid);
|
||||
|
||||
Reference in New Issue
Block a user