mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-18 03:59:38 +00:00
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:
35
src/parser/classes/CompactChannel.ts
Normal file
35
src/parser/classes/CompactChannel.ts
Normal 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;
|
||||
Reference in New Issue
Block a user