🐞 fix: 修复netease解析的部分问题

This commit is contained in:
zhiyu1998 2023-04-10 23:16:14 +08:00
parent 03ee875a79
commit 24bb343e59
2 changed files with 6 additions and 5 deletions

View File

@ -247,7 +247,7 @@ export class neteasepro extends plugin {
// 非小程序
const title = await getSongDetail(id).then(res => {
const song = res.songs?.[0];
return song.length > 0
return song?.length > 0
? `${song?.name}-${song?.ar?.[0].name}`.replace(/[\/\?<>\\:\*\|".… ]/g, "")
: "暂无信息";
});

View File

@ -793,7 +793,7 @@ export class tools extends plugin {
// 小红书解析
async redbook(e) {
// 解析短号
// 正则说明匹配手机链接、匹配小程序、匹配PC链接
let msgUrl =
/(http:|https:)\/\/(xhslink|xiaohongshu).com\/[A-Za-z\d._?%&+\-=\/#@]*/.exec(
e.msg,
@ -804,6 +804,7 @@ export class tools extends plugin {
|| /(http:|https:)\/\/www\.xiaohongshu\.com\/explore\/(\w+)/.exec(
e.msg,
)?.[0]
// 解析短号
let id;
if (msgUrl.includes("xhslink")) {
await fetch(msgUrl, {