mirror of
https://github.com/imsyy/DailyHotApi.git
synced 2026-01-12 13:14:55 +08:00
🐞 fix: 修复启动异常
This commit is contained in:
@@ -119,7 +119,7 @@ app.get("/all", (c) =>
|
||||
if (excludeRoutes.includes(path)) {
|
||||
return {
|
||||
name: path,
|
||||
path: null,
|
||||
path: undefined,
|
||||
message: "该接口暂时下线",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ const getList = async (options: Options, noCache: boolean): Promise<RouterResTyp
|
||||
desc: v.desc || "该视频暂无简介",
|
||||
cover: v.pic?.replace(/http:/, "https:"),
|
||||
author: v.author,
|
||||
timestamp: null,
|
||||
timestamp: undefined,
|
||||
hot: v.video_review,
|
||||
url: `https://www.bilibili.com/video/${v.bvid}`,
|
||||
mobileUrl: `https://m.bilibili.com/video/${v.bvid}`,
|
||||
|
||||
@@ -29,8 +29,8 @@ const getList = async (noCache: boolean): Promise<RouterResType> => {
|
||||
data: list.map((v: RouterType["csdn"]) => ({
|
||||
id: v.productId,
|
||||
title: v.articleTitle,
|
||||
cover: v.picList?.[0] || null,
|
||||
desc: null,
|
||||
cover: v.picList?.[0] || undefined,
|
||||
desc: undefined,
|
||||
author: v.nickName,
|
||||
timestamp: getTime(v.period),
|
||||
hot: Number(v.hotRankScore),
|
||||
|
||||
@@ -30,7 +30,7 @@ const getDyCookies = async () => {
|
||||
return cookieData;
|
||||
} catch (error) {
|
||||
console.error("获取抖音 Cookie 出错" + error);
|
||||
return null;
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ const getList = async (options: Options, noCache: boolean) => {
|
||||
title: data.subject,
|
||||
desc: data.content,
|
||||
cover: data.cover || data?.images?.[0],
|
||||
author: v.user?.nickname || null,
|
||||
author: v.user?.nickname || undefined,
|
||||
timestamp: getTime(data.created_at),
|
||||
hot: data.view_status,
|
||||
url: `https://www.miyoushe.com/ys/article/${data.post_id}`,
|
||||
|
||||
@@ -44,11 +44,11 @@ const getList = async (options: Options, noCache: boolean) => {
|
||||
data: list.map((v: RouterType["history"], index: number) => ({
|
||||
id: index,
|
||||
title: load(v.title).text().trim(),
|
||||
cover: v.cover ? v.pic_share : null,
|
||||
cover: v.cover ? v.pic_share : undefined,
|
||||
desc: load(v.desc).text().trim(),
|
||||
year: v.year,
|
||||
timestamp: null,
|
||||
hot: null,
|
||||
timestamp: undefined,
|
||||
hot: undefined,
|
||||
url: v.link,
|
||||
mobileUrl: v.link,
|
||||
})),
|
||||
|
||||
@@ -44,7 +44,7 @@ const getList = async (options: Options, noCache: boolean) => {
|
||||
title: data.subject,
|
||||
desc: data.content,
|
||||
cover: data.cover || data?.images?.[0],
|
||||
author: v.user?.nickname || null,
|
||||
author: v.user?.nickname || undefined,
|
||||
timestamp: getTime(data.created_at),
|
||||
hot: data.view_status,
|
||||
url: `https://www.miyoushe.com/bh3/article/${data.post_id}`,
|
||||
|
||||
@@ -43,7 +43,7 @@ const getList = async (options: Options, noCache: boolean) => {
|
||||
title: v.title,
|
||||
author: v.username,
|
||||
hot: v.replies,
|
||||
timestamp: null,
|
||||
timestamp: undefined,
|
||||
url: `https://bbs.hupu.com/${v.tid}.html`,
|
||||
mobileUrl: v.url,
|
||||
})),
|
||||
|
||||
@@ -46,7 +46,7 @@ const getList = async (noCache: boolean) => {
|
||||
desc: titleProcessing(v.content).intro,
|
||||
author: v.user_info.username,
|
||||
timestamp: getTime(v.publish_time),
|
||||
hot: null,
|
||||
hot: undefined,
|
||||
url: v.url || `https://www.huxiu.com/moment/${v.object_id}.html`,
|
||||
mobileUrl: v.url || `https://m.huxiu.com/moment/${v.object_id}.html`,
|
||||
})),
|
||||
|
||||
@@ -38,7 +38,7 @@ const getList = async (noCache: boolean) => {
|
||||
const href = dom.find("a").attr("href");
|
||||
const time = dom.find("span.time").text().trim();
|
||||
const match = time.match(/'([^']+)'/);
|
||||
const dateTime = match ? match[1] : null;
|
||||
const dateTime = match ? match[1] : undefined;
|
||||
return {
|
||||
id: href ? Number(replaceLink(href, true)) : 100000,
|
||||
title: dom.find(".newsbody h2").text().trim(),
|
||||
|
||||
@@ -64,7 +64,7 @@ const getList = async (options: Options, noCache: boolean): Promise<RouterResTyp
|
||||
title: data.subject,
|
||||
desc: data.content,
|
||||
cover: data.cover || data?.images?.[0],
|
||||
author: v.user?.nickname || null,
|
||||
author: v.user?.nickname || undefined,
|
||||
timestamp: getTime(data.created_at),
|
||||
hot: data.view_status || 0,
|
||||
url: `https://www.miyoushe.com/ys/article/${data.post_id}`,
|
||||
|
||||
@@ -30,7 +30,7 @@ const getList = async (noCache: boolean) => {
|
||||
title: v.title,
|
||||
cover: v.imgsrc,
|
||||
author: v.source,
|
||||
hot: null,
|
||||
hot: undefined,
|
||||
timestamp: getTime(v.ptime),
|
||||
url: `https://www.163.com/dy/article/${v.docid}.html`,
|
||||
mobileUrl: `https://m.163.com/dy/article/${v.docid}.html`,
|
||||
|
||||
@@ -127,7 +127,7 @@ const getList = async (options: Options, noCache: boolean) => {
|
||||
data: list.map((v: RouterType["sina-news"]) => ({
|
||||
id: v.id,
|
||||
title: v.title,
|
||||
author: v.media || null,
|
||||
author: v.media || undefined,
|
||||
hot: parseFloat(v.top_num.replace(/,/g, "")),
|
||||
timestamp: getTime(v.create_date + " " + v.create_time),
|
||||
url: v.url,
|
||||
|
||||
@@ -50,9 +50,9 @@ const getList = async (options: Options, noCache: boolean) => {
|
||||
return {
|
||||
id: base.base.uniqueId,
|
||||
title: info.title,
|
||||
desc: null,
|
||||
author: null,
|
||||
timestamp: null,
|
||||
desc: undefined,
|
||||
author: undefined,
|
||||
timestamp: undefined,
|
||||
hot: parseChineseNumber(info.hotValue),
|
||||
url: base.base.url,
|
||||
mobileUrl: base.base.url,
|
||||
|
||||
@@ -44,7 +44,7 @@ const getList = async (options: Options, noCache: boolean) => {
|
||||
title: data.subject,
|
||||
desc: data.content,
|
||||
cover: data.cover || data?.images?.[0],
|
||||
author: v.user?.nickname || null,
|
||||
author: v.user?.nickname || undefined,
|
||||
timestamp: getTime(data.created_at),
|
||||
hot: data.view_status,
|
||||
url: `https://www.miyoushe.com/sr/article/${data.post_id}`,
|
||||
|
||||
@@ -40,7 +40,7 @@ const getList = async (options: Options, noCache: boolean) => {
|
||||
title: v.title,
|
||||
desc: v.content,
|
||||
author: v.member.username,
|
||||
timestamp: null,
|
||||
timestamp: undefined,
|
||||
hot: v.replies,
|
||||
url: v.url,
|
||||
mobileUrl: v.url,
|
||||
|
||||
@@ -40,7 +40,7 @@ const getList = async (options: Options, noCache: boolean) => {
|
||||
desc: v.issuetime + " " + v.title,
|
||||
cover: v.pic,
|
||||
timestamp: getTime(v.issuetime),
|
||||
hot: null,
|
||||
hot: undefined,
|
||||
url: `http://nmc.cn${v.url}`,
|
||||
mobileUrl: `http://nmc.cn${v.url}`,
|
||||
})),
|
||||
|
||||
@@ -35,10 +35,10 @@ const getList = async (noCache: boolean) => {
|
||||
data: list.map((v: RouterType["zhihu-daily"]) => ({
|
||||
id: v.id,
|
||||
title: v.title,
|
||||
cover: v.images?.[0] ?? null,
|
||||
cover: v.images?.[0] ?? undefined,
|
||||
author: v.hint,
|
||||
hot: null,
|
||||
timestamp: null,
|
||||
hot: undefined,
|
||||
timestamp: undefined,
|
||||
url: v.url,
|
||||
mobileUrl: v.url,
|
||||
})),
|
||||
|
||||
@@ -112,7 +112,7 @@ export const getTime = (timeInput: string | number): number | undefined => {
|
||||
"YYYY-MM-DD",
|
||||
];
|
||||
|
||||
let parsedDate: dayjs.Dayjs | null = null;
|
||||
let parsedDate: dayjs.Dayjs | undefined = undefined;
|
||||
for (const pattern of formatPatterns) {
|
||||
parsedDate = dayjs(standardizedInput, pattern, true);
|
||||
if (parsedDate.isValid()) {
|
||||
|
||||
@@ -61,7 +61,7 @@ const getWereadID = (bookId: string) => {
|
||||
return strSub;
|
||||
} catch (error) {
|
||||
console.error("处理微信读书 ID 时出现错误:" + error);
|
||||
return null;
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user