mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🐞 fix: 修复netease解析的部分问题
This commit is contained in:
parent
03ee875a79
commit
24bb343e59
@ -247,7 +247,7 @@ export class neteasepro extends plugin {
|
|||||||
// 非小程序
|
// 非小程序
|
||||||
const title = await getSongDetail(id).then(res => {
|
const title = await getSongDetail(id).then(res => {
|
||||||
const song = res.songs?.[0];
|
const song = res.songs?.[0];
|
||||||
return song.length > 0
|
return song?.length > 0
|
||||||
? `${song?.name}-${song?.ar?.[0].name}`.replace(/[\/\?<>\\:\*\|".… ]/g, "")
|
? `${song?.name}-${song?.ar?.[0].name}`.replace(/[\/\?<>\\:\*\|".… ]/g, "")
|
||||||
: "暂无信息";
|
: "暂无信息";
|
||||||
});
|
});
|
||||||
|
@ -793,17 +793,18 @@ export class tools extends plugin {
|
|||||||
|
|
||||||
// 小红书解析
|
// 小红书解析
|
||||||
async redbook(e) {
|
async redbook(e) {
|
||||||
// 解析短号
|
// 正则说明:匹配手机链接、匹配小程序、匹配PC链接
|
||||||
let msgUrl =
|
let msgUrl =
|
||||||
/(http:|https:)\/\/(xhslink|xiaohongshu).com\/[A-Za-z\d._?%&+\-=\/#@]*/.exec(
|
/(http:|https:)\/\/(xhslink|xiaohongshu).com\/[A-Za-z\d._?%&+\-=\/#@]*/.exec(
|
||||||
e.msg,
|
e.msg,
|
||||||
)?.[0]
|
)?.[0]
|
||||||
|| /(http:|https:)\/\/www\.xiaohongshu\.com\/discovery\/item\/(\w+)/.exec(
|
|| /(http:|https:)\/\/www\.xiaohongshu\.com\/discovery\/item\/(\w+)/.exec(
|
||||||
e.message[0].data,
|
e.message[0].data,
|
||||||
)?.[0]
|
)?.[0]
|
||||||
|| /(http:|https:)\/\/www\.xiaohongshu\.com\/explore\/(\w+)/.exec(
|
|| /(http:|https:)\/\/www\.xiaohongshu\.com\/explore\/(\w+)/.exec(
|
||||||
e.msg,
|
e.msg,
|
||||||
)?.[0]
|
)?.[0]
|
||||||
|
// 解析短号
|
||||||
let id;
|
let id;
|
||||||
if (msgUrl.includes("xhslink")) {
|
if (msgUrl.includes("xhslink")) {
|
||||||
await fetch(msgUrl, {
|
await fetch(msgUrl, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user