feat: add support for YouTube Kids (#291)

* dev: add `WEB_KIDS` innertube client

* refactor: move DASH manifest stuff out of `VideoInfo`
This makes it easier to use these functions elsewhere.

* feat(ytkids): add `Kids#getInfo()` & `Kids#search()`

* feat: add `Innertube#kids.getHomeFeed()`

* docs: add YouTube Kids API ref

* docs: fix typo

* docs: fix yet another typo

* docs: update YouTube Music API ref
Unrelated but required to reflect changes made to the DASH manifest generation functions

* chore: lint

* chore: add tests

* feat: include `captions` in `VideoInfo`

* chore: fix tests
This commit is contained in:
LuanRT
2023-01-23 03:39:51 -03:00
committed by GitHub
parent 13ad3774c9
commit 2bbefefbb7
25 changed files with 1114 additions and 384 deletions

View File

@@ -0,0 +1,25 @@
import Parser from '..';
import Text from './misc/Text';
import Thumbnail from './misc/Thumbnail';
import NavigationEndpoint from './NavigationEndpoint';
import SubscribeButton from './SubscribeButton';
import { YTNode } from '../helpers';
class SlimOwner extends YTNode {
static type = 'SlimOwner';
thumbnail: Thumbnail[];
title: Text;
endpoint: NavigationEndpoint;
subscribe_button: SubscribeButton | null;
constructor(data: any) {
super();
this.thumbnail = Thumbnail.fromResponse(data.thumbnail);
this.title = new Text(data.title);
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
this.subscribe_button = Parser.parseItem<SubscribeButton>(data.subscribeButton, SubscribeButton);
}
}
export default SlimOwner;