mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-04 03:51:00 +00:00
refactor!: finish parser migration
Finally! :) This removes all code related to the old parser. #65
This commit is contained in:
29
lib/parser/classes/MusicShelf.js
Normal file
29
lib/parser/classes/MusicShelf.js
Normal file
@@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
const Parser = require('..');
|
||||
const Text = require('./Text');
|
||||
const NavigationEndpoint = require('./NavigationEndpoint');
|
||||
|
||||
class MusicShelf {
|
||||
type = 'MusicShelf';
|
||||
|
||||
constructor(data) {
|
||||
this.title = new Text(data.title).toString();
|
||||
|
||||
this.contents = Parser.parse(data.contents);
|
||||
|
||||
if (data.bottomEndpoint) {
|
||||
this.endpoint = new NavigationEndpoint(data.bottomEndpoint);
|
||||
}
|
||||
|
||||
if (data.continuations) {
|
||||
this.continuation = data.continuations?.[0].nextContinuationData.continuation;
|
||||
}
|
||||
|
||||
if (data.bottomText) {
|
||||
this.bottom_text = new Text(data.bottomText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = MusicShelf;
|
||||
Reference in New Issue
Block a user