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,35 @@
import Parser from '..';
import Text from './misc/Text';
import Thumbnail from './misc/Thumbnail';
import NavigationEndpoint from './NavigationEndpoint';
import type Menu from './menus/Menu';
import { YTNode } from '../helpers';
class CompactChannel extends YTNode {
static type = 'CompactChannel';
title: Text;
channel_id: string;
thumbnail: Thumbnail[];
display_name: Text;
video_count: Text;
subscriber_count: Text;
endpoint: NavigationEndpoint;
tv_banner: Thumbnail[];
menu: Menu | null;
constructor(data: any) {
super();
this.title = new Text(data.title);
this.channel_id = data.channelId;
this.thumbnail = Thumbnail.fromResponse(data.thumbnail);
this.display_name = new Text(data.displayName);
this.video_count = new Text(data.videoCountText);
this.subscriber_count = new Text(data.subscriberCountText);
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
this.tv_banner = Thumbnail.fromResponse(data.tvBanner);
this.menu = Parser.parseItem<Menu>(data.menu);
}
}
export default CompactChannel;