mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-20 04:51:16 +00:00
feat: add parsers for TimeWatched
This commit is contained in:
18
src/parser/classes/misc/ChildElement.ts
Normal file
18
src/parser/classes/misc/ChildElement.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
class ChildElement {
|
||||
static type = 'ChildElement';
|
||||
|
||||
text: string | null;
|
||||
properties;
|
||||
child_elements?: ChildElement[];
|
||||
|
||||
constructor(data: any) {
|
||||
this.text = data.type.textType?.text?.content || null;
|
||||
this.properties = data.properties;
|
||||
|
||||
if (data.childElements) {
|
||||
this.child_elements = data.childElements.map((el: any) => new ChildElement(el));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default ChildElement;
|
||||
Reference in New Issue
Block a user