mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-20 04:51:16 +00:00
fix(VideoInfo.ts): reimplement get music_tracks (#409)
* fix(VideoInfo.ts): reimplement `get music_tracks` - Add parser classes to parse needed data - Add `CarouselLockup` - Add `EngagementPanelSectionList` - Add `InfoRow` - Add `StructuredDescriptionContent` - Add `VideoDescriptionMusicSection` - Add `VideoDescriptionHeader` - Add `Factoid` - Add `ExpandableVideoDescriptionBody` - Add `AdsEngagementPanelContent` - Add `engagement_panels` to raw and parsed next responses - Add `engagement_panels` parsing code to `parser.ts` * Check for song inside of video_lockup first before checking info_rows * Add support for pulling artist ids out of music_tracks - Add support for WRITERS InfoRow - Check for video id inside of naviagation endpoint on info_row metadata * Add `AdsEngagementPanelContent` to ignore list * Switch `map => parseItem` to `parseArray` * Use `Text` && `NavigationEndpoint` * Replace `String` with `Text` in `ExpandableVideoDescriptionBody`
This commit is contained in:
20
src/parser/classes/CarouselLockup.ts
Normal file
20
src/parser/classes/CarouselLockup.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { type ObservedArray, YTNode } from '../helpers.js';
|
||||
import InfoRow from './InfoRow.js';
|
||||
import Parser, { type RawNode } from '../index.js';
|
||||
import CompactVideo from './CompactVideo.js';
|
||||
|
||||
export default class CarouselLockup extends YTNode {
|
||||
static type = 'CarouselLockup';
|
||||
|
||||
info_rows: ObservedArray<InfoRow>;
|
||||
video_lockup?: CompactVideo;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.info_rows = Parser.parseArray(data.infoRows, InfoRow);
|
||||
const video_lockup = Parser.parseItem(data.videoLockup, CompactVideo);
|
||||
if (video_lockup != null) {
|
||||
this.video_lockup = video_lockup;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user