mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 04:21:35 +00:00
refactor: Clean up & fix old code
Other changes: - Renamed "getShortsWatchItem" to "getShortsVideoInfo". - Fixed `ShortFormVideoInfo`. This never worked for me ever since it was introduced. Turned out it was just implemented incorrectly. - Moved `basic_info` extraction to `MediaInfo`. Less of a pain to maintain as we only have to modify one file. - Removed unneeded tsdoc comments. - Fixed `Innertube#getStreamingData()`. Now it actually returns a deciphered format. - Simplified some types.
This commit is contained in:
@@ -13,7 +13,7 @@ export default class CompactVideo extends YTNode {
|
||||
|
||||
id: string;
|
||||
thumbnails: Thumbnail[];
|
||||
rich_thumbnail?: SuperParsedResult<YTNode>;
|
||||
rich_thumbnail?: YTNode;
|
||||
title: Text;
|
||||
author: Author;
|
||||
view_count: Text;
|
||||
@@ -36,7 +36,7 @@ export default class CompactVideo extends YTNode {
|
||||
this.thumbnails = Thumbnail.fromResponse(data.thumbnail) || null;
|
||||
|
||||
if (Reflect.has(data, 'richThumbnail')) {
|
||||
this.rich_thumbnail = Parser.parse(data.richThumbnail);
|
||||
this.rich_thumbnail = Parser.parseItem(data.richThumbnail);
|
||||
}
|
||||
|
||||
this.title = new Text(data.title);
|
||||
|
||||
Reference in New Issue
Block a user