Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/icons/douban.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions server/glob.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ declare module 'glob:./sources/{*.ts,**/index.ts}' {
export const chongbuluo: typeof import('./sources/chongbuluo')
export const cls: typeof import('./sources/cls/index')
export const coolapk: typeof import('./sources/coolapk/index')
export const douban: typeof import('./sources/douban')
export const douyin: typeof import('./sources/douyin')
export const fastbull: typeof import('./sources/fastbull')
export const gelonghui: typeof import('./sources/gelonghui')
Expand Down
46 changes: 46 additions & 0 deletions server/sources/douban.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
interface HotMoviesRes {
category: string
tags: []
items: MovieItem[]
recommend_tags: []
total: number
type: string
}

interface MovieItem {
rating: {
count: number
max: number
star_count: number
value: number
}
title: string
pic: {
large: string
normal: string
}
is_new: boolean
uri: string
episodes_info: string
card_subtitle: string
type: string
id: string
}

export default defineSource(async () => {
const baseURL = "https://m.douban.com/rexxar/api/v2/subject/recent_hot/movie"
const res: HotMoviesRes = await myFetch(baseURL, {
headers: {
Referer: "https://movie.douban.com/",
Accept: "application/json, text/plain, */*",
},
})
return res.items.map(movie => ({
id: movie.id,
title: `《${movie.title}》${movie.card_subtitle}`,
url: `https://movie.douban.com/subject/${movie.id}`,
extra: {
hover: movie.card_subtitle,
},
}))
})
3 changes: 2 additions & 1 deletion shared/pinyin.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@
"juejin": "xitujuejin",
"ifeng": "fenghuangwang-redianzixun",
"chongbuluo-latest": "chongbuluo-zuixin",
"chongbuluo-hot": "chongbuluo-zuire"
"chongbuluo-hot": "chongbuluo-zuire",
"douban": "douban-remendianying"
}
12 changes: 9 additions & 3 deletions shared/pre-sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,14 @@ export const originSources = {
},
},
},
"douban": {
name: "豆瓣",
column: "china",
title: "热门电影",
color: "green",
type: "hottest",
home: "https://www.douban.com",
},
} as const satisfies Record<string, OriginSource>

export function genSources() {
Expand Down Expand Up @@ -461,10 +469,8 @@ export function genSources() {
_.filter(([_, v]) => {
if (v.disable === "cf" && process.env.CF_PAGES) {
return false
} else if (v.disable === true) {
return false
} else {
return true
return v.disable !== true
}
}),
)
Expand Down
9 changes: 9 additions & 0 deletions shared/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,5 +472,14 @@
"color": "green",
"interval": 1800000,
"title": "最热"
},
"douban": {
"title": "热门电影",
"name": "豆瓣",
"type": "hottest",
"column": "china",
"home": "https://www.douban.com",
"color": "green",
"interval": 600000
}
}