mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-26 00:02:09 +00:00
refactor!: finish parser migration
Finally! :) This removes all code related to the old parser. #65
This commit is contained in:
27
lib/parser/classes/SectionList.js
Normal file
27
lib/parser/classes/SectionList.js
Normal file
@@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
|
||||
const Parser = require('..');
|
||||
|
||||
class SectionList {
|
||||
type = 'SectionList';
|
||||
|
||||
constructor(data) {
|
||||
if (data.targetId) {
|
||||
this.target_id = data.targetId;
|
||||
}
|
||||
this.contents = Parser.parse(data.contents);
|
||||
|
||||
if (data.continuations) {
|
||||
if (data.continuations[0].nextContinuationData) {
|
||||
this.continuation = data.continuations[0].nextContinuationData.continuation;
|
||||
} else if (data.continuations[0].reloadContinuationData) {
|
||||
this.continuation = data.continuations[0].reloadContinuationData.continuation;
|
||||
}
|
||||
}
|
||||
if (data.header) {
|
||||
this.header = Parser.parse(data.header);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = SectionList;
|
||||
Reference in New Issue
Block a user