feat: add settings page parser (#154)

* feat: add settings page parsers

* fix(AccountManager): small ts error

* feat: add `CopyLink` & `SettingsCheckbox`

* deps: remove “flat” dependency
This commit is contained in:
LuanRT
2022-08-28 05:11:11 -03:00
committed by GitHub
parent 05b4593e0a
commit 13a86cb4e7
21 changed files with 349 additions and 151 deletions

View File

@@ -122,9 +122,7 @@ class Comment extends YTNode {
const dialog_button = dialog.item().as(CommentReplyDialog).reply_button.item().as(ToggleButton);
const payload = {
params: {
commentText: text
}
commentText: text
};
const response = await dialog_button.endpoint.callTest(this.#actions, payload);

View File

@@ -35,7 +35,7 @@ class CommentThread extends YTNode {
throw new InnertubeError('This comment has no replies.', { comment_id: this.comment?.comment_id });
const continuation = this.#replies.key('contents').parsed().array().get({ type: 'ContinuationItem' })?.as(ContinuationItem);
const response = await continuation?.endpoint.callTest(this.#actions);
const response = await continuation?.endpoint.callTest(this.#actions, { parse: true });
this.replies = response?.on_response_received_endpoints_memo?.getType(Comment).map((comment) => {
comment.setActions(this.#actions);
@@ -60,7 +60,7 @@ class CommentThread extends YTNode {
if (!this.#actions)
throw new InnertubeError('Actions not set for this CommentThread.');
const response = await this.#continuation.button?.item().key('endpoint').nodeOfType(NavigationEndpoint).callTest(this.#actions);
const response = await this.#continuation.button?.item().key('endpoint').nodeOfType(NavigationEndpoint).callTest(this.#actions, { parse: true });
this.replies = response?.on_response_received_endpoints_memo.getType(Comment).map((comment) => {
comment.setActions(this.#actions);