piped-api/src/types.ts

170 lines
3 KiB
TypeScript
Raw Normal View History

2023-08-03 20:36:16 +03:00
export interface Streams {
audioStreams: AudioStream[];
dash: string | null;
description: string;
dislikes: number;
duration: number;
hls: string | null;
lbryId: string;
likes: number;
livestream: boolean;
proxyUrl: string;
relatedStreams: Video[];
subtitles: Subtitle[];
thumbnailUrl: string;
title: string;
uploadedDate: string;
uploader: string;
uploaderUrl: string;
uploaderVerified: boolean;
videoStreams: VideoStream[];
views: number;
}
export interface AudioStream {
bitrate: number;
codec: string;
format: string;
indexEnd: number;
indexStart: number;
initStart: number;
initEnd: number;
mimeType: string;
quality: string;
url: string;
videoOnly: boolean;
}
export interface Subtitle {
autoGenerated: boolean;
code: string;
mimeType: string;
name: string;
url: string;
}
export interface VideoStream {
bitrate: number;
codec: string;
format: string;
fps: number;
height: number;
indexEnd: number;
indexStart: number;
initStart: number;
initEnd: number;
mimeType: string;
quality: string;
url: string;
videoOnly: boolean;
width: number;
}
export interface Comments {
comments: Comment[];
disabled: boolean;
nextpage: string;
}
export interface Comment {
author: string;
commentId: string;
commentText: string;
commentedTime: string;
commentorUrl: string;
hearted: boolean;
likeCount: number;
pinned: boolean;
thumbnail: string;
verified: boolean;
}
export interface Video {
duration: number;
thumbnail: string;
title: string;
uploadedDate: string;
uploaderAvatar: string;
uploaderUrl: string;
uploaderVerified: boolean;
2023-08-08 18:29:24 +03:00
uploaderName: string;
2023-08-03 20:36:16 +03:00
url: string;
views: number;
2023-08-03 21:28:23 +03:00
isShort: boolean;
uploaded: number;
shortDescription: string;
2023-08-08 17:33:10 +03:00
type?: string;
2023-08-03 20:36:16 +03:00
}
export interface Channel {
avatarUrl: string;
bannerUrl: string;
description: string;
id: string;
name: string;
2023-08-09 19:35:58 +03:00
tabs: TabInfo[];
2023-08-03 20:36:16 +03:00
nextpage: string;
relatedStreams: Video[];
subscriberCount: number;
verified: boolean;
2023-08-08 17:33:10 +03:00
type?: string;
2023-08-03 20:36:16 +03:00
}
2023-08-09 19:35:58 +03:00
export interface TabInfo {
name: string;
data: string;
}
export interface Tab {
nextpage: string;
content: TabResp[];
}
export type TabResp = Video | Channel | Playlist;
2023-08-03 20:36:16 +03:00
export interface NextPageChannel {
nextpage: string;
relatedStreams: Video[];
}
export interface Playlist {
bannerUrl: string;
name: string;
nextpage: string;
relatedStreams: Video[];
thumbnailUrl: string;
uploader: string;
uploaderAvatar: string;
uploaderUrl: string;
videos: number;
2023-08-09 19:35:58 +03:00
type?: string;
2023-08-03 20:36:16 +03:00
}
export interface NextPagePlaylist {
nextpage: string;
relatedStreams: Video[];
}
export interface Sponsors {
hash: string;
segments: Segments[];
videoId: string;
}
export interface Segments {
UUID: string;
actionType: string;
category: string;
segment: string;
videoDuration: number;
}
2023-08-08 17:33:10 +03:00
export interface Search {
nextpage: string;
2023-08-09 15:54:51 +03:00
items: Item[];
2023-08-08 17:33:10 +03:00
corrected: boolean;
suggestion: string | null;
}
2023-08-09 15:54:51 +03:00
export type Item = Video | Channel;