mirror of
https://github.com/artegoser/piped-api.git
synced 2024-11-05 20:13:58 +03:00
feat: channel tabs
This commit is contained in:
parent
a37588554b
commit
5465963650
4 changed files with 22 additions and 3 deletions
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "piped-api",
|
||||
"version": "1.1.6",
|
||||
"version": "1.2.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "piped-api",
|
||||
"version": "1.1.6",
|
||||
"version": "1.2.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "^1.4.0"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "piped-api",
|
||||
"version": "1.1.6",
|
||||
"version": "1.2.0",
|
||||
"description": "",
|
||||
"main": "dist/index.js",
|
||||
"type": "module",
|
||||
|
|
|
@ -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…
Reference in a new issue