mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🐞 fix: V1.4.3 修复小蓝鸟解析
ps. 目前的替代方案:使用第三方解析,但是无法解析组图,只能解析单个图片,望周知!
This commit is contained in:
parent
2fae4c4c37
commit
9ed0770e46
@ -118,6 +118,8 @@ chmod a+rx ~/.local/bin/yt-dlp
|
|||||||
### ✖️ 小蓝鸟问题
|
### ✖️ 小蓝鸟问题
|
||||||
**2024-2-5**,修复小蓝鸟的时候看到free计划已经[没有给查看Tweet的api](https://developer.twitter.com/en/portal/products/basic),原先[使用的库也出现了403报错](https://github.com/PLhery/node-twitter-api-v2),开通会员要100美元,不值得。目前暂停更新,后续有方案和精力再更新!
|
**2024-2-5**,修复小蓝鸟的时候看到free计划已经[没有给查看Tweet的api](https://developer.twitter.com/en/portal/products/basic),原先[使用的库也出现了403报错](https://github.com/PLhery/node-twitter-api-v2),开通会员要100美元,不值得。目前暂停更新,后续有方案和精力再更新!
|
||||||
|
|
||||||
|
> 2024/2/26 目前的替代方案:使用第三方解析,但是无法解析组图,只能解析单个图片,望周知!
|
||||||
|
|
||||||
## 🤺 R插件交流群
|
## 🤺 R插件交流群
|
||||||
扫码不行就:575663150
|
扫码不行就:575663150
|
||||||
|
|
||||||
|
@ -92,8 +92,8 @@ export class tools extends plugin {
|
|||||||
fnc: "wiki",
|
fnc: "wiki",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
reg: "(twitter.com)",
|
reg: "(x.com)",
|
||||||
fnc: "twitter",
|
fnc: "twitter_x",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
reg: "(acfun.cn)",
|
reg: "(acfun.cn)",
|
||||||
@ -610,6 +610,42 @@ export class tools extends plugin {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 使用现有api解析小蓝鸟
|
||||||
|
async twitter_x(e) {
|
||||||
|
// 配置参数及解析
|
||||||
|
const reg = /https?:\/\/x.com\/[0-9-a-zA-Z_]{1,20}\/status\/([0-9]*)/;
|
||||||
|
const twitterUrl = reg.exec(e.msg)[0];
|
||||||
|
// 提取视频
|
||||||
|
const videoUrl = XIGUA_REQ_LINK.replace("{}", twitterUrl);
|
||||||
|
e.reply("识别:小蓝鸟");
|
||||||
|
axios.get(videoUrl, {
|
||||||
|
headers: {
|
||||||
|
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
||||||
|
'Accept-Language': 'zh-CN,zh;q=0.9',
|
||||||
|
'Cache-Control': 'no-cache',
|
||||||
|
'Connection': 'keep-alive',
|
||||||
|
'Pragma': 'no-cache',
|
||||||
|
'Sec-Fetch-Dest': 'document',
|
||||||
|
'Sec-Fetch-Mode': 'navigate',
|
||||||
|
'Sec-Fetch-Site': 'none',
|
||||||
|
'Sec-Fetch-User': '?1',
|
||||||
|
'Upgrade-Insecure-Requests': '1',
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36',
|
||||||
|
|
||||||
|
},
|
||||||
|
timeout: 10000 // 设置超时时间
|
||||||
|
}).then(resp => {
|
||||||
|
const url = resp.data.data?.url;
|
||||||
|
if (url && (url.endsWith(".jpg") || url.endsWith(".png"))) {
|
||||||
|
e.reply(segment.image(url));
|
||||||
|
} else {
|
||||||
|
this.downloadVideo(url).then(path => {
|
||||||
|
e.reply(segment.video(path + "/temp.mp4"));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// acfun解析
|
// acfun解析
|
||||||
async acfun(e) {
|
async acfun(e) {
|
||||||
const path = `${ this.getCurDownloadPath(e) }/temp/`;
|
const path = `${ this.getCurDownloadPath(e) }/temp/`;
|
||||||
@ -1096,6 +1132,7 @@ export class tools extends plugin {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 米游社
|
||||||
async miyoushe(e) {
|
async miyoushe(e) {
|
||||||
let msg = /(?:https?:\/\/)?(m|www)\.miyoushe\.com\/[A-Za-z\d._?%&+\-=\/#]*/.exec(e.msg)[0];
|
let msg = /(?:https?:\/\/)?(m|www)\.miyoushe\.com\/[A-Za-z\d._?%&+\-=\/#]*/.exec(e.msg)[0];
|
||||||
const id = /\/(\d+)$/.exec(msg)?.[0].replace("\/", "");
|
const id = /\/(\d+)$/.exec(msg)?.[0].replace("\/", "");
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
- {
|
- {
|
||||||
version: 1.4.2,
|
version: 1.4.3,
|
||||||
data:
|
data:
|
||||||
[
|
[
|
||||||
新增<span class="cmd">米游社解析</span>功能,
|
新增<span class="cmd">米游社解析</span>功能,
|
||||||
|
@ -13,13 +13,13 @@ function escapeSpecialChars(str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const parseVideoName = videoInfo => {
|
const parseVideoName = videoInfo => {
|
||||||
const strAc号 = "ac" + (videoInfo?.dougaId || "");
|
const acfunId = "ac" + (videoInfo?.dougaId || "");
|
||||||
const str标题 = videoInfo?.title;
|
const acfunTitle = videoInfo?.title;
|
||||||
const str作者 = videoInfo?.user.name;
|
const acfunAuthor = videoInfo?.user.name;
|
||||||
const str上传时间 = videoInfo?.createTime;
|
const uploadTime = videoInfo?.createTime;
|
||||||
const str描述 = videoInfo?.description;
|
const description = videoInfo?.description;
|
||||||
|
|
||||||
const raw = [strAc号, str标题, str作者, str上传时间, str描述]
|
const raw = [acfunId, acfunTitle, acfunAuthor, uploadTime, description]
|
||||||
.map(d => d || "")
|
.map(d => d || "")
|
||||||
.join("_")
|
.join("_")
|
||||||
.slice(0, 100);
|
.slice(0, 100);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user