Files
YouTube.js/lib/parser/youtube/History.js
LuanRT 1d62e469a9 refactor: rewrite Comments Section logic (#88)
* feat: add core comments section classes

* chore: update type declarations

* chore: fix linter warnings

* style: fix linter

* chore: update tests

* chore(tests): fix typo

* chore(tests): fix typo x2

* fix(tests): `getReplies()` method is only present in `CommentThread` and not `Comment`

* chore(tests): fix comment id path

* chore(tests): remove outdated code

* chore(tests): fix results path

* chore: enforce code style

* chore: update type declarations

* docs: add examples and documentation

* chore(docs): fix paths

* chore(docs): fix more paths

* chore(docs): fix `Comments.js` path

* chore(docs): fix typo

* chore(docs): mention example file

* chore(examples): fix imports

* chore(examples): fix typo
2022-07-02 19:55:33 -03:00

32 lines
773 B
JavaScript

'use strict';
const Feed = require('../../core/Feed');
// TODO: make filter actions usable
/** @namespace */
class History extends Feed {
/**
* @param {import('../../core/Actions')} actions
* @param {object} data - parsed data.
* @param {boolean} already_parsed
*/
constructor(actions, data, already_parsed = false) {
super(actions, data, already_parsed);
this.sections = this.memo.get('ItemSection');
this.feed_actions = this.memo.get('BrowseFeedActions')?.[0] || [];
}
/**
* Retrieves next batch of contents.
*
* @returns {Promise.<History>}
*/
async getContinuation() {
const continuation = await this.getContinuationData();
return new History(this.actions, continuation, true);
}
}
module.exports = History;