mirror of
https://github.com/artegoser/piped-api.git
synced 2024-11-21 18:56:22 +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",
|
"name": "piped-api",
|
||||||
"version": "1.1.6",
|
"version": "1.2.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "piped-api",
|
"name": "piped-api",
|
||||||
"version": "1.1.6",
|
"version": "1.2.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.4.0"
|
"axios": "^1.4.0"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "piped-api",
|
"name": "piped-api",
|
||||||
"version": "1.1.6",
|
"version": "1.2.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {
|
||||||
Search,
|
Search,
|
||||||
Sponsors,
|
Sponsors,
|
||||||
Streams,
|
Streams,
|
||||||
|
Tab,
|
||||||
Video,
|
Video,
|
||||||
} from "./types";
|
} from "./types";
|
||||||
|
|
||||||
|
@ -77,6 +78,10 @@ export class PipedAPI {
|
||||||
: await this._get(`/channel/${id}`);
|
: 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.
|
* Retrieves a channel by its name.
|
||||||
*
|
*
|
||||||
|
|
14
src/types.ts
14
src/types.ts
|
@ -102,6 +102,7 @@ export interface Channel {
|
||||||
description: string;
|
description: string;
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
tabs: TabInfo[];
|
||||||
nextpage: string;
|
nextpage: string;
|
||||||
relatedStreams: Video[];
|
relatedStreams: Video[];
|
||||||
subscriberCount: number;
|
subscriberCount: number;
|
||||||
|
@ -109,6 +110,18 @@ export interface Channel {
|
||||||
type?: string;
|
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 {
|
export interface NextPageChannel {
|
||||||
nextpage: string;
|
nextpage: string;
|
||||||
relatedStreams: Video[];
|
relatedStreams: Video[];
|
||||||
|
@ -124,6 +137,7 @@ export interface Playlist {
|
||||||
uploaderAvatar: string;
|
uploaderAvatar: string;
|
||||||
uploaderUrl: string;
|
uploaderUrl: string;
|
||||||
videos: number;
|
videos: number;
|
||||||
|
type?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NextPagePlaylist {
|
export interface NextPagePlaylist {
|
||||||
|
|
Loading…
Add table
Reference in a new issue