mirror of
https://github.com/artegoser/piped-api.git
synced 2025-02-23 20:51:27 +03:00
feat: channel tabs
This commit is contained in:
parent
a37588554b
commit
5465963650
4 changed files with 22 additions and 3 deletions
|
@ -8,6 +8,7 @@ import {
|
|||
Search,
|
||||
Sponsors,
|
||||
Streams,
|
||||
Tab,
|
||||
Video,
|
||||
} from "./types";
|
||||
|
||||
|
@ -77,6 +78,10 @@ export class PipedAPI {
|
|||
: await this._get(`/channel/${id}`);
|
||||
}
|
||||
|
||||
async channelTabs(data: string): Promise<Tab> {
|
||||
return await this._get(`/channels/tabs/?data=${data}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a channel by its name.
|
||||
*
|
||||
|
|
14
src/types.ts
14
src/types.ts
|
@ -102,6 +102,7 @@ export interface Channel {
|
|||
description: string;
|
||||
id: string;
|
||||
name: string;
|
||||
tabs: TabInfo[];
|
||||
nextpage: string;
|
||||
relatedStreams: Video[];
|
||||
subscriberCount: number;
|
||||
|
@ -109,6 +110,18 @@ export interface Channel {
|
|||
type?: string;
|
||||
}
|
||||
|
||||
export interface TabInfo {
|
||||
name: string;
|
||||
data: string;
|
||||
}
|
||||
|
||||
export interface Tab {
|
||||
nextpage: string;
|
||||
content: TabResp[];
|
||||
}
|
||||
|
||||
export type TabResp = Video | Channel | Playlist;
|
||||
|
||||
export interface NextPageChannel {
|
||||
nextpage: string;
|
||||
relatedStreams: Video[];
|
||||
|
@ -124,6 +137,7 @@ export interface Playlist {
|
|||
uploaderAvatar: string;
|
||||
uploaderUrl: string;
|
||||
videos: number;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export interface NextPagePlaylist {
|
||||
|
|
Loading…
Add table
Reference in a new issue