feat: V1.5.12 新增微视解析

1. 新增微视解析
2. 修复netease_music(目前判断为证书过期)问题
This commit is contained in:
zhiyu1998 2024-03-24 18:55:07 +08:00
parent be3aaeff92
commit 2e81be1457
3 changed files with 61 additions and 7 deletions

View File

@ -51,7 +51,7 @@ import {
TWITTER_TWEET_INFO, TWITTER_TWEET_INFO,
XHS_REQ_LINK, XHS_REQ_LINK,
XHS_VIDEO, XHS_VIDEO,
GENERAL_REQ_LINK, WEIBO_SINGLE_INFO GENERAL_REQ_LINK, WEIBO_SINGLE_INFO, WEISHI_VIDEO_INFO
} from "../constants/tools.js"; } from "../constants/tools.js";
import child_process from 'node:child_process' import child_process from 'node:child_process'
import { getAudio, getVideo } from "../utils/y2b.js"; import { getAudio, getVideo } from "../utils/y2b.js";
@ -150,6 +150,10 @@ export class tools extends plugin {
{ {
reg: "(pixivision.net)", reg: "(pixivision.net)",
fnc: "pixivision" fnc: "pixivision"
},
{
reg: "(isee.weishi.qq.com)",
fnc: "weishi"
} }
], ],
}); });
@ -1251,6 +1255,52 @@ export class tools extends plugin {
return true; return true;
} }
// 微视
async weishi(e) {
// 拦截恶意链接 【后续如果有小程序检测可以删除这个逻辑】
if (!e.msg.includes('https://isee.weishi.qq.com/ws/app-pages/share/index.html')) {
e.reply("识别微视但无法完整检测到视频ID");
// 打个日志 方便后面出bug知道位置
logger.error("[R插件][微视] 无法检测链接")
return true;
}
const url = e.msg;
try {
const idMatch = url.match(/id=(.*)&spid/);
if (!idMatch || idMatch.length !== 2) {
e.reply("识别微视但无法完整检测到视频ID");
// 打个日志 方便后面出bug知道位置
logger.error("[R插件][微视] 无法检测到ID逻辑大概问题在正则表达式")
return true;
}
const feedId = idMatch[1];
const response = await axios.get(WEISHI_VIDEO_INFO.replace("{}", feedId), {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36",
}
});
const weishiResponse = response.data;
const firstFeed = weishiResponse.data.feeds[0];
// 标题、封面、视频链接
const title = firstFeed.feed_desc;
const cover = firstFeed.images[0].url;
const noWatermarkDownloadUrl = firstFeed.video_url;
e.reply([segment.image(cover), `识别:微视,${ title }`]);
this.downloadVideo(noWatermarkDownloadUrl).then(path => {
e.reply(segment.video(path + "/temp.mp4"));
});
} catch (err) {
logger.error(err);
return true;
}
return true;
}
/** /**
* 哔哩哔哩下载 * 哔哩哔哩下载
* @param title * @param title

View File

@ -1,12 +1,10 @@
- { - {
version: 1.5.11, version: 1.5.12,
data: data:
[ [
新增<span class="cmd">微视解析</span>功能,
新增<span class="cmd">小世界解析</span>功能, 新增<span class="cmd">小世界解析</span>功能,
新增<span class="cmd">贴吧解析</span>功能, 新增<span class="cmd">贴吧解析</span>功能,
优化<span class="cmd">哔哩哔哩简介</span>功能,
新增<span class="cmd">皮皮搞笑解析</span>功能,
新增<span class="cmd">皮皮虾解析</span>功能,
支持<span class="cmd">锅巴</span>插件,方便查看和修改配置, 支持<span class="cmd">锅巴</span>插件,方便查看和修改配置,
添加<span class="cmd">#R帮助</span>获取插件帮助, 添加<span class="cmd">#R帮助</span>获取插件帮助,
添加<span class="cmd">#R版本</span>获取插件版本, 添加<span class="cmd">#R版本</span>获取插件版本,

View File

@ -94,16 +94,22 @@ export const GENERAL_REQ_LINK_2 = {
* 获取网易云歌曲下载链接 * 获取网易云歌曲下载链接
* @type {string} * @type {string}
*/ */
export const NETEASE_SONG_DOWNLOAD = "https://www.oranges1.top/neteaseapi.do/song/url?id={}" export const NETEASE_SONG_DOWNLOAD = "https://neteasecloudmusicapi.vercel.app/song/url?id={}"
/** /**
* 获取网易云歌曲详情 * 获取网易云歌曲详情
* @type {string} * @type {string}
*/ */
export const NETEASE_SONG_DETAIL = "https://www.oranges1.top/neteaseapi.do/song/detail?ids={}" export const NETEASE_SONG_DETAIL = "https://neteasecloudmusicapi.vercel.app/song/detail?ids={}"
/** /**
* 单条微博的接口 * 单条微博的接口
* @type {string} * @type {string}
*/ */
export const WEIBO_SINGLE_INFO = "https://m.weibo.cn/statuses/show?id={}" export const WEIBO_SINGLE_INFO = "https://m.weibo.cn/statuses/show?id={}"
/**
* 微视接口
* @type {string}
*/
export const WEISHI_VIDEO_INFO = "https://h5.weishi.qq.com/webapp/json/weishi/WSH5GetPlayPage?feedid={}"