refactor: move api response types to ~/models/apiModels

This commit is contained in:
Hakadao
2023-12-04 00:37:59 +08:00
parent 69e16d780c
commit a6769f0f0d
18 changed files with 790 additions and 305 deletions

View File

@@ -1,14 +1,15 @@
<script setup lang="ts">
// import PopularAnimeCarousel from './components/PopularAnimeCarousel.vue'
import AnimeTimeTable from './components/AnimeTimeTable.vue'
import type { AnimeItem, PopularAnime } from './types'
import { getUserID, openLinkToNewTab } from '~/utils/main'
import { numFormatter } from '~/utils/dataFormatter'
import emitter from '~/utils/mitt'
import type { List as WatchListItem, WatchListResult } from '~/models/apiModels/anime/watchList'
import type { List as PopularAnimeItem, PopularAnimeResult } from '~/models/apiModels/anime/popular'
import type { ItemSubItem as RecommendationItem, RecommendationResult } from '~/models/apiModels/anime/recommendation'
const animeWatchList = reactive<AnimeItem[]>([])
const recommendAnimeList = reactive<AnimeItem[]>([])
const popularAnimeList = reactive<AnimeItem[]>([])
const animeWatchList = reactive<WatchListItem[]>([])
const recommendAnimeList = reactive<RecommendationItem[]>([])
const popularAnimeList = reactive<PopularAnimeItem[]>([])
const cursor = ref<number>(0)
const isLoadingAnimeWatchList = ref<boolean>()
const isLoadingPopularAnime = ref<boolean>()
@@ -40,13 +41,13 @@ function getAnimeWatchList() {
pn: 1,
ps: 30,
})
.then((response) => {
.then((response: WatchListResult) => {
const {
code,
data: { list },
} = response
if (code === 0)
Object.assign(animeWatchList, list as AnimeItem[])
Object.assign(animeWatchList, list as WatchListItem[])
})
.catch(() => Object.assign(animeWatchList, []))
.finally(() => {
@@ -61,14 +62,14 @@ function getRecommendAnimeList() {
contentScriptQuery: 'getRecommendAnimeList',
coursor: cursor.value,
})
.then((response) => {
.then((response: RecommendationResult) => {
const {
code,
data: { items, coursor, has_next },
} = response
if (code === 0 && has_next) {
if (recommendAnimeList.length === 0)
Object.assign(recommendAnimeList, items[0].sub_items as AnimeItem[])
Object.assign(recommendAnimeList, items[0].sub_items as RecommendationItem[])
else recommendAnimeList.push(...items[0].sub_items)
cursor.value = coursor
@@ -85,13 +86,13 @@ function getPopularAnimeList() {
.sendMessage({
contentScriptQuery: 'getPopularAnimeList',
})
.then((response) => {
.then((response: PopularAnimeResult) => {
const {
code,
result: { list },
} = response
if (code === 0)
Object.assign(popularAnimeList, list as PopularAnime[])
Object.assign(popularAnimeList, list as PopularAnimeItem[])
})
.catch(() => {})
.finally(() => isLoadingPopularAnime.value = false)
@@ -255,3 +256,4 @@ function getPopularAnimeList() {
--at-apply: mb-8 mt-14 first:mt-0;
}
</style>
~/models/apiModels/anime/watchList

View File

@@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n'
import browser from 'webextension-polyfill'
import type { AnimeTimeTableItem } from '../types'
import { removeHttpFromUrl } from '~/utils/main'
import type { Result as TimetableItem, TimetableResult } from '~/models/apiModels/anime/timetable'
const { t } = useI18n()
@@ -31,10 +32,10 @@ function getAnimeTimeTable() {
.sendMessage({
contentScriptQuery: 'getAnimeTimeTable',
})
.then((res) => {
.then((res: TimetableResult) => {
const { code, result } = res
if (code === 0)
Object.assign(animeTimeTable, result as AnimeTimeTableItem[])
Object.assign(animeTimeTable, result as TimetableItem[])
})
}
</script>

View File

@@ -1,105 +0,0 @@
<script setup lang="ts">
import type { PopularAnime } from '../types'
const popularAnimeList = reactive<PopularAnime[]>([])
const activatedAnime = ref<PopularAnime>()
const bannerContent = ref<HTMLElement>()
const bannerHeight = ref<number>(0)
onload = () => {
bannerHeight.value = bannerContent.value?.offsetHeight as number
}
onresize = () => {
bannerHeight.value = bannerContent.value?.offsetHeight as number
}
onMounted(() => {
getPopularAnimeList()
})
function getPopularAnimeList() {
browser.runtime
.sendMessage({
contentScriptQuery: 'getPopularAnimeList',
})
.then((response) => {
const {
code,
result: { list },
} = response
if (code === 0) {
Object.assign(popularAnimeList, list.slice(0, 7) as PopularAnime[])
activatedAnime.value = popularAnimeList[0]
}
})
}
</script>
<template>
<div ref="bannerContent" w-full h-800px pos="absolute top-0 left-0" z="-1">
<!-- banner mask -->
<div
pos="absolute bottom-0 left-0"
w-full
h-300px
bg="gradient-to-b gradient-from-transparent gradient-to-$bew-bg"
z-1
/>
<div
:style="{
backgroundImage: `url(${activatedAnime?.ss_horizontal_cover})`,
}"
bg="cover center"
duration-600
w-full
h-full
pos="absolute"
after:content-none
after:pos="absolute top-0 left-0"
after:w-full
after:h-full
/>
</div>
<!-- banner -->
<div h-800px z-1 pos="relative" flex justify-center>
<div>
<!-- <img
:src="activatedAnime?.ss_horizontal_cover.replace('https:', '')"
pointer-events-none
rounded="$bew-radius"
h="[calc(100%-170px)]"
> -->
<!-- <div text="2xl white" p-4 pos="relative" bg="black opacity-60">
{{ activatedAnime?.title }}
</div> -->
</div>
</div>
<div flex="~ justify-between" m="t--350px">
<ul
w="1/3"
ml-auto
flex
overflow-hidden
z-1
relative
>
<li
v-for="(item, index) in popularAnimeList"
:key="index"
pr-2
flex="~ 1 gap-2 shrink-0"
@mouseover="activatedAnime = item"
>
<img :src="item.cover.replace('https:', '')">
<!-- <div flex items-center>
{{ item.title }}
</div> -->
</li>
</ul>
</div>
</template>
<style lang="scss" scoped></style>

View File

@@ -1,90 +0,0 @@
export interface PopularAnime {
badge: '独家' | '会员抢先' | '会员专享' | '出品'
badge_info: {
bg_color: string
bg_color_night: string
text: string
}
badge_type: number
copyright: string
cover: string // 豎向封面
new_ep: {
cover: string
index_show: string
}
rank: number // 排名
rating: string // 評分
season_id: number
ss_horizontal_cover: string // 橫向封面
stat: {
danmaku: number // 彈幕
follow: number // 訂閲
series_follow: number // 當前系列訂閲???
view: number // 觀看數
}
title: string
url: string
}
export interface AnimeItem {
cover: string
horizontal_cover_16_9?: string
episode_id: number
evaluate: string
hover: {
img: string
text: string[] // 番劇風格
}
link: string
url: string
rank_id: number
rating: string
rating_count: number
report: object
season_id: number
season_type: number
stat: {
danmaku: number
duration: number
view: number
series_follow: number
}
sub_title: string
subtitle: string
text: string[]
title: string
user_status: {
follow: number
}
progress: string
is_finish: 1 | 0 // 是否已經完結
total_count: number // 當前集數
styles: string[] // 番劇風格
rank: number
}
// https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/bangumi/timeline.md#%E8%8E%B7%E5%8F%96%E7%95%AA%E5%89%A7%E6%88%96%E5%BD%B1%E8%A7%86%E6%97%B6%E9%97%B4%E7%BA%BF
export interface AnimeTimeTableItem {
date: string
date_ts: number
day_of_week: number
episodes: Array<{
cover: string
delay: number
delay_id: number
delay_index: string
delay_reason: string
ep_cover: string
episode_id: number
follows: string
plays: string
pub_index: string
pub_time: string
pub_ts: number
published: number
season_id: number
square_cover: string
title: string
}>
is_today: number
}

View File

@@ -4,11 +4,13 @@ import { getCSRF, getUserID, openLinkToNewTab, removeHttpFromUrl } from '~/utils
import type { FavoriteCategory, FavoriteResource } from '~/components/Topbar/types'
import emitter from '~/utils/mitt'
import { settings } from '~/logic'
import type { Media as FavoriteItem, FavoritesResult } from '~/models/apiModels/video/favorite'
import type { List as CategoryItem, FavoritesCategoryResult } from '~/models/apiModels/video/favoriteCategory'
const { t } = useI18n()
const favoriteCategories = reactive<Array<FavoriteCategory>>([])
const favoriteResources = reactive<Array<FavoriteResource>>([])
const favoriteCategories = reactive<CategoryItem[]>([])
const favoriteResources = reactive<FavoriteItem[]>([])
const categoryOptions = reactive<Array<{ value: any; label: string }>>([])
const selectedCategory = ref<FavoriteCategory>()
@@ -69,7 +71,7 @@ async function getFavoriteCategories() {
contentScriptQuery: 'getFavoriteCategories',
mid: getUserID(),
})
.then((res) => {
.then((res: FavoritesCategoryResult) => {
if (res.code === 0) {
Object.assign(favoriteCategories, res.data.list)
@@ -99,7 +101,7 @@ async function getFavoriteResources(
isFullPageLoading.value = true
isLoading.value = true
try {
const res = await browser.runtime
const res: FavoritesResult = await browser.runtime
.sendMessage({
contentScriptQuery: 'getFavoriteResources',
mediaId,

View File

@@ -1,11 +1,14 @@
<script setup lang="ts">
import { useDateFormat } from '@vueuse/core'
import { useI18n } from 'vue-i18n'
import { HistoryType } from './types'
import type { HistoryItem } from './types'
// import type { HistoryItem } from './types'
import { getCSRF, openLinkToNewTab, removeHttpFromUrl } from '~/utils/main'
import { calcCurrentTime } from '~/utils/dataFormatter'
import emitter from '~/utils/mitt'
import { Business } from '~/models/apiModels/video/history'
import type { List as HistoryItem, HistoryResult } from '~/models/apiModels/video/history'
import type { List as HistorySearchItem, HistorySearchResult } from '~/models/apiModels/video/historySearch'
const { t } = useI18n()
@@ -16,6 +19,10 @@ const currentPageNum = ref<number>(1)
const keyword = ref<string>()
const historyStatus = ref<boolean>()
const HistoryBusiness = computed(() => {
return Business
})
watch(
() => keyword.value,
(newValue, oldValue) => {
@@ -76,7 +83,7 @@ function getHistoryList() {
? historyList[historyList.length - 1].view_at
: 0,
})
.then((res) => {
.then((res: HistoryResult) => {
if (res.code === 0) {
if (Array.isArray(res.data.list) && res.data.list.length > 0)
historyList.push(...res.data.list)
@@ -101,7 +108,7 @@ function searchHistoryList() {
pn: currentPageNum.value++,
keyword: keyword.value,
})
.then((res) => {
.then((res: HistorySearchResult) => {
if (res.code === 0) {
if (historyList.length !== 0 && res.data.list.length < 20) {
isLoading.value = false
@@ -109,8 +116,8 @@ function searchHistoryList() {
return
}
res.data.list.forEach((item: HistoryItem) => {
historyList.push(item)
res.data.list.forEach((item: HistorySearchItem) => {
historyList.push(item as HistoryItem)
})
noMoreContent.value = false
@@ -162,7 +169,7 @@ function getHistoryUrl(item: HistoryItem) {
function getHistoryItemCover(item: HistoryItem) {
if (item.history.business === 'article')
return removeHttpFromUrl(item.covers[0])
return removeHttpFromUrl(`${item.covers[0]}`)
return removeHttpFromUrl(item.cover)
}
@@ -322,7 +329,7 @@ function jumpToLoginPage() {
>
<span
v-if="historyItem.history.business !== HistoryType.Archive"
v-if="historyItem.history.business !== HistoryBusiness.ARCHIVE"
pos="absolute right-0 top-0"
bg="$bew-theme-color"
text="xs white"
@@ -331,19 +338,19 @@ function jumpToLoginPage() {
rounded="$bew-radius-half"
>
<template
v-if="historyItem.history.business === HistoryType.Live"
v-if="historyItem.history.business === HistoryBusiness.LIVE"
>
Livestreaming
</template>
<template
v-else-if="
historyItem.history.business === HistoryType.Article
historyItem.history.business === HistoryBusiness.ARCHIVE
"
>
Article
</template>
<template
v-else-if="historyItem.history.business === HistoryType.PGC"
v-else-if="historyItem.history.business === HistoryBusiness.PGC"
>
Anime
</template>
@@ -351,8 +358,8 @@ function jumpToLoginPage() {
<div
v-if="
historyItem.history.business === HistoryType.Archive
|| historyItem.history.business === HistoryType.PGC
historyItem.history.business === HistoryBusiness.ARCHIVE
|| historyItem.history.business === HistoryBusiness.PGC
"
pos="absolute bottom-0 right-0"
bg="black opacity-60"
@@ -374,8 +381,8 @@ function jumpToLoginPage() {
<div w-full pos="absolute bottom-0" bg="white opacity-60">
<Progress
v-if="
historyItem.history.business === HistoryType.Archive
|| historyItem.history.business === HistoryType.PGC
historyItem.history.business === HistoryBusiness.ARCHIVE
|| historyItem.history.business === HistoryBusiness.PGC
"
:percentage="
(historyItem.progress / historyItem.duration) * 100

View File

@@ -1,31 +0,0 @@
// https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/history&toview/history.md#%E8%8E%B7%E5%8F%96%E5%8E%86%E5%8F%B2%E8%AE%B0%E5%BD%95%E5%88%97%E8%A1%A8_web%E7%AB%AF
export enum HistoryType {
Archive = 'archive', // archive稿件
PGC = 'pgc', // pgc剧集 (番剧 / 影视)
Live = 'live', // live直播
ArticleList = 'article-list', // article-list文集
Article = 'article', // article文章
}
export interface HistoryItem {
title: string
cover: string
covers: Array<string>
history: {
business: HistoryType
epid: number
bvid: string
part: string
oid: number
}
author_name: string
author_face: string
author_mid: string
view_at: number
progress: number
duration: number
kid: number
live_status: 0 | 1 // 0未开播 1已开播
uri: string
show_title: string
}

View File

@@ -1,16 +1,16 @@
<script setup lang="ts">
import { useDateFormat } from '@vueuse/core'
import { useI18n } from 'vue-i18n'
import type { WatchLaterModel } from './types'
import { getCSRF, openLinkToNewTab, removeHttpFromUrl } from '~/utils/main'
import { calcCurrentTime } from '~/utils/dataFormatter'
import emitter from '~/utils/mitt'
import type { List as VideoItem, WatchLaterResult } from '~/models/apiModels/video/watchLater'
const { t } = useI18n()
const isLoading = ref<boolean>()
const noMoreContent = ref<boolean>()
const watchLaterList = reactive<Array<WatchLaterModel>>([])
const watchLaterList = reactive<VideoItem[]>([])
onMounted(() => {
getAllWatchLaterList()
@@ -36,7 +36,7 @@ function getAllWatchLaterList() {
.sendMessage({
contentScriptQuery: 'getAllWatchLaterList',
})
.then((res) => {
.then((res: WatchLaterResult) => {
if (res.code === 0)
Object.assign(watchLaterList, res.data.list)

View File

@@ -1,44 +0,0 @@
export interface WatchLaterModel {
aid: number
videos: number
tid: number
tname: string
copyright: number
pic: string
title: string
pubdate: number
ctime: number
desc: string
state: number
duration: number
mission_id: number
rights: {}
owner: {
mid: number
name: string
face: string
}
stat: {
aid: number
view: number
danmaku: number
reply: number
favorite: number
coin: number
share: number
now_rank: number
his_rank: number
like: number
dislike: number
}
short_link_v2: string
first_frame: string
count: number
cid: number
progress: number
add_at: number
bvid: string
uri: string
viewed: boolean
enable_vt: number
}

View File

@@ -0,0 +1,51 @@
export interface PopularAnimeResult {
code: number
message: string
result: Result
}
export interface Result {
list: List[]
note: string
}
export interface List {
badge: string
badge_info: BadgeInfo
badge_type: number
copyright: string
cover: string
enable_vt: boolean
icon_font: IconFont
new_ep: NewEp
rank: number
rating: string
season_id: number
ss_horizontal_cover: string
stat: Stat
title: string
url: string
}
export interface BadgeInfo {
bg_color: string
bg_color_night: string
text: string
}
export interface IconFont {
name: string
text: string
}
export interface NewEp {
cover: string
index_show: string
}
export interface Stat {
danmaku: number
follow: number
series_follow: number
view: number
}

View File

@@ -0,0 +1,88 @@
export interface RecommendationResult {
code: number
data: Data
message: string
}
export interface Data {
coursor: number
has_next: boolean
items: Item[]
}
export interface Item {
rank_id: number
sub_items: ItemSubItem[]
text: any[]
}
export interface ItemSubItem {
card_style: string
cover: string
episode_id?: number
evaluate?: string
hover?: Hover
inline?: Inline
link?: string
rank_id: number
rating?: string
rating_count?: number
report: Report
season_id?: number
season_type?: number
stat?: Stat
sub_title: string
text: any[]
title: string
user_status?: UserStatus
sub_items?: SubItemSubItem[]
}
export interface Hover {
img: string
text: string[]
}
export interface Inline {
end_time: number
ep_id: number
first_ep: number
material_no: string
scene: number
start_time: number
}
export interface Report {
first_ep?: number
scene?: number
}
export interface Stat {
danmaku: number
duration: number
view: number
}
export interface SubItemSubItem {
card_style: string
cover: string
evaluate: string
hover: Hover
inline: Inline
link: string
rank_id: number
rating?: string
rating_count?: number
report: Report
season_id: number
season_type: number
stat: Stat
sub_title: string
text: any[]
title: string
user_status: UserStatus
}
export interface UserStatus {
follow: number
}

View File

@@ -0,0 +1,40 @@
export interface TimetableResult {
code: number
message: string
result: Result[]
}
export interface Result {
date: string
date_ts: number
day_of_week: number
episodes: Episode[]
is_today: number
}
export interface Episode {
cover: string
delay: number
delay_id: number
delay_index: string
delay_reason: string
enable_vt: boolean
ep_cover: string
episode_id: number
follow: number
follows: string
icon_font: IconFont
plays: string
pub_index: string
pub_time: string
pub_ts: number
published: number
season_id: number
square_cover: string
title: string
}
export interface IconFont {
name: string
text: string
}

View File

@@ -0,0 +1,225 @@
export interface WatchListResult {
code: number
message: string
ttl: number
data: Data
}
export interface Data {
list: List[]
pn: number
ps: number
total: number
}
export interface List {
season_id: number
media_id: number
season_type: number
season_type_name: SeasonTypeName
title: string
cover: string
total_count: number
is_finish: number
is_started: number
is_play: number
badge: Badge
badge_type: number
rights: Rights
stat: Stat
new_ep: FirstEpInfo
rating: Rating
square_cover: string
season_status: number
season_title: string
badge_ep: BadgeEp
media_attr: number
season_attr: number
evaluate: string
areas: Area[]
subtitle: string
first_ep: number
can_watch: number
series: Series
publish: Publish
mode: number
section: Section[]
url: string
badge_info: BadgeInfo
renewal_time?: string
first_ep_info: FirstEpInfo
formal_ep_count: number
short_url: string
badge_infos?: BadgeInfos
season_version: SeasonVersion
subtitle_14?: string
viewable_crowd_type: number
summary: string
styles: string[]
follow_status: number
is_new: number
progress: string
both_follow: boolean
producers?: Producer[]
horizontal_cover_16_9?: string
horizontal_cover_16_10?: string
config_attrs?: ConfigAttrs
subtitle_25?: string
}
export interface Area {
id: number
name: Name
}
export enum Name {
= '中国大陆',
= '日本',
}
export enum Badge {
Empty = '',
= '会员专享',
= '独家',
}
export enum BadgeEp {
Empty = '',
= '会员',
}
export interface BadgeInfo {
text?: Badge
bg_color: BgColor
bg_color_night: BgColorNight
img?: string
multi_img: MultiImg
}
export enum BgColor {
Fb7299 = '#FB7299',
The00C0Ff = '#00C0FF',
}
export enum BgColorNight {
Bb5B76 = '#BB5B76',
The0B91Be = '#0B91BE',
}
export interface MultiImg {
color: string
medium_remind: string
}
export interface BadgeInfos {
content_attr?: BadgeInfo
vip_or_pay?: BadgeInfo
}
export interface ConfigAttrs {
highlight_ineffective_hd?: HighlightIneffective
highlight_ineffective_ott?: HighlightIneffective
highlight_ineffective_pink?: HighlightIneffective
cc_on_lock?: CcOnLock
}
export interface CcOnLock {
type_url: string
value: string
}
export interface HighlightIneffective {
type_url: string
}
export interface FirstEpInfo {
id: number
cover: string
title: string
long_title?: string
pub_time: Date
duration: number
index_show?: string
}
export interface Producer {
mid: number
type: number
is_contribute?: number
}
export interface Publish {
pub_time: Date
pub_time_show: string
release_date: Date
release_date_show: string
pub_time_show_db?: string
}
export interface Rating {
score: number
count: number
}
export interface Rights {
allow_review: number
is_selection: number
selection_style: number
demand_end_time: DemandEndTime
is_rcmd?: number
allow_preview?: number
allow_bp?: number
allow_bp_rank?: number
}
export interface DemandEndTime {
}
export enum SeasonTypeName {
= '国创',
= '番剧',
}
export enum SeasonVersion {
Movie = 'movie',
Tv = 'tv',
}
export interface Section {
section_id: number
season_id: number
limit_group: number
watch_platform: number
copyright: Copyright
ban_area_show?: number
episode_ids: number[]
type?: number
title?: string
attr?: number
}
export enum Copyright {
Bilibili = 'bilibili',
Dujia = 'dujia',
Ugc = 'ugc',
}
export interface Series {
series_id: number
title: string
season_count: number
new_season_id: number
series_ord: number
}
export interface Stat {
follow: number
view: number
danmaku: number
reply: number
coin: number
series_follow: number
series_view: number
likes: number
favorite: number
}

View File

@@ -0,0 +1,91 @@
export interface FavoritesResult {
code: number
message: string
ttl: number
data: Data
}
export interface Data {
info: Info
medias: Media[]
has_more: boolean
ttl: number
}
export interface Info {
id: number
fid: number
mid: number
attr: number
title: string
cover: string
upper: InfoUpper
cover_type: number
cnt_info: InfoCntInfo
type: number
intro: string
ctime: number
mtime: number
state: number
fav_state: number
like_state: number
media_count: number
}
export interface InfoCntInfo {
collect: number
play: number
thumb_up: number
share: number
}
export interface InfoUpper {
mid: number
name: string
face: string
followed: boolean
vip_type: number
vip_statue: number
}
export interface Media {
id: number
type: number
title: string
cover: string
intro: string
page: number
duration: number
upper: MediaUpper
attr: number
cnt_info: MediaCntInfo
link: string
ctime: number
pubtime: number
fav_time: number
bv_id: string
bvid: string
season: null
ogv: null
ugc: Ugc
}
export interface MediaCntInfo {
collect: number
play: number
danmaku: number
vt: number
play_switch: number
reply: number
view_text_1: string
}
export interface Ugc {
first_cid: number
}
export interface MediaUpper {
mid: number
name: string
face: string
}

View File

@@ -0,0 +1,22 @@
export interface FavoritesCategoryResult {
code: number
message: string
ttl: number
data: Data
}
export interface Data {
count: number
list: List[]
season: null
}
export interface List {
id: number
fid: number
mid: number
attr: number
title: string
fav_state: number
media_count: number
}

View File

@@ -0,0 +1,68 @@
export interface HistoryResult {
code: number
message: string
ttl: number
data: Data
}
export interface Data {
cursor: Cursor
tab: Tab[]
list: List[]
}
export interface Cursor {
max: number
view_at: number
business: Business | string
ps: number
}
export enum Business {
ARCHIVE = 'archive',
PGC = 'pgc',
LIVE = 'live',
ARTICLE = 'article',
}
export interface List {
title: string
long_title: string
cover: string
covers: null
uri: string
history: History
videos: number
author_name: string
author_face: string
author_mid: number
view_at: number
progress: number
badge: string
show_title: string
duration: number
current: string
total: number
new_desc: string
is_finish: number
is_fav: number
kid: number
tag_name: string
live_status: number
}
export interface History {
oid: number
epid: number
bvid: string
page: number
cid: number
part: string
business: Business
dt: number
}
export interface Tab {
type: string
name: string
}

View File

@@ -0,0 +1,69 @@
export interface HistorySearchResult {
code: number
message: string
ttl: number
data: Data
}
export interface Data {
has_more: boolean
page: Page
list: List[]
}
export interface List {
title: string
long_title: string
cover: string
covers: null
uri: string
history: History
videos: number
author_name: string
author_face: string
author_mid: number
view_at: number
progress: number
badge: string
show_title: ShowTitle
duration: number
total: number
new_desc: NewDesc
is_finish: number
is_fav: number
kid: number
tag_name: string
live_status: number
}
export interface History {
oid: number
epid: number
bvid: string
page: number
cid: number
part: string
business: Business
dt: number
}
export enum Business {
Archive = 'archive',
}
export enum NewDesc {
Empty = '',
2P = '共2P',
4P = '共4P',
}
export enum ShowTitle {
Empty = '',
JohnLennonOnceSaid = 'john lennon once said',
The4K = '4K',
}
export interface Page {
pn: number
total: number
}

View File

@@ -0,0 +1,89 @@
export interface WatchLaterResult {
code: number
message: string
ttl: number
data: Data
}
export interface Data {
count: number
list: List[]
}
export interface List {
aid: number
videos: number
tid: number
tname: string
copyright: number
pic: string
title: string
pubdate: number
ctime: number
desc: string
state: number
duration: number
rights: { [key: string]: number }
owner: Owner
stat: { [key: string]: number }
dynamic: Dynamic
dimension: Dimension
short_link_v2: string
up_from_v2?: number
first_frame: string
pub_location: string
page: Page
count: number
cid: number
progress: number
add_at: number
bvid: string
uri: string
enable_vt: number
view_text_1: string
card_type: number
left_icon_type: number
left_text: string
right_icon_type: number
right_text: string
arc_state: number
pgc_label: string
show_up: boolean
forbid_fav: boolean
forbid_sort: boolean
season_id?: number
mission_id?: number
}
export interface Dimension {
width: number
height: number
rotate: number
}
export enum Dynamic {
Empty = '',
= '后期鸽看了看自己暗淡无光的羽毛,又看了看你们手里闪闪发光的硬币',
}
export interface Owner {
mid: number
name: string
face: string
}
export interface Page {
cid: number
page: number
from: From
part: string
duration: number
vid: string
weblink: string
dimension: Dimension
first_frame: string
}
export enum From {
Vupload = 'vupload',
}