mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🐞 fix: [#I85G9L]修复douyin解析
1. 修复了当前版本的douyin解析问题 2. 加入了douyin_ck 3. 更新了README 4. 加入了未来计划的功能
This commit is contained in:
parent
fa2db4d6fc
commit
df66c85ee6
47
README.md
47
README.md
@ -38,7 +38,7 @@ utils -- 工具类
|
|||||||
1.【必要】下载插件
|
1.【必要】下载插件
|
||||||
```shell
|
```shell
|
||||||
git clone https://gitee.com/kyrzy0416/rconsole-plugin.git ./plugins/rconsole-plugin/
|
git clone https://gitee.com/kyrzy0416/rconsole-plugin.git ./plugins/rconsole-plugin/
|
||||||
``````
|
```
|
||||||
|
|
||||||
2.【必要】在`Yunzai-Bot`目录下安装axios(0.27.2)、魔法工具(tunnel)、哔哩哔哩总结(chatgpt-api)依赖
|
2.【必要】在`Yunzai-Bot`目录下安装axios(0.27.2)、魔法工具(tunnel)、哔哩哔哩总结(chatgpt-api)依赖
|
||||||
|
|
||||||
@ -56,8 +56,9 @@ sudo apt-get install ffmpeg
|
|||||||
# Windows 参考:https://www.jianshu.com/p/5015a477de3c
|
# Windows 参考:https://www.jianshu.com/p/5015a477de3c
|
||||||
````
|
````
|
||||||
4. 【可选】小程序解析适配了:
|
4. 【可选】小程序解析适配了:
|
||||||
* 原版的衍变:[Yoimiya / Yunzai-Bot](https://gitee.com/yoimiya-kokomi/Yunzai-Bot)
|
* 喵崽:[Yoimiya / Miao-Yunzai](https://gitee.com/yoimiya-kokomi/Miao-Yunzai)
|
||||||
* 如果你不用原神选择:[听语惊花 / Yunzai-Bot-lite](https://gitee.com/Nwflower/yunzai-bot-lite)
|
* TRSS:[时雨◎星空 / Yunzai](https://gitee.com/TimeRainStarSky/Yunzai)
|
||||||
|
* 听语惊花:[听语惊花 / Yunzai-Bot-lite](https://gitee.com/Nwflower/yunzai-bot-lite)
|
||||||
|
|
||||||
> 如果解析有问题参考issue:[#I6MFF7](https://gitee.com/kyrzy0416/rconsole-plugin/issues/I6MFF7)
|
> 如果解析有问题参考issue:[#I6MFF7](https://gitee.com/kyrzy0416/rconsole-plugin/issues/I6MFF7)
|
||||||
|
|
||||||
@ -71,22 +72,13 @@ sudo apt-get install ffmpeg
|
|||||||
- 在config/tools.yaml里设置`biliDuration`
|
- 在config/tools.yaml里设置`biliDuration`
|
||||||
- 锅巴设置
|
- 锅巴设置
|
||||||
|
|
||||||
7. 【可选】基于文字识别的拓展功能
|
|
||||||
> 代码解释:
|
|
||||||
> <img src="./img/example8.webp" alt="小程序解析" style="zoom:50%;" />
|
|
||||||
> 英文翻译和优化:
|
|
||||||
> <img src="./img/example9.webp" alt="小程序解析" style="zoom:50%;" />
|
|
||||||
> 总结:
|
|
||||||
> <img src="./img/example10.webp" alt="小程序解析" style="zoom:50%;" />
|
|
||||||
|
|
||||||
## 🐤 Q&A
|
## 🐤 Q&A
|
||||||
> 哔哩哔哩的SESSDATA?
|
> 哔哩哔哩的SESSDATA?
|
||||||
> 进入哔哩哔哩网站 -- 打开F12开发者选项 -- 应用 -- 找到Cookie -- 找到SESSDATA -- 复制 -- 粘贴到plugins/rconsole-plugin/config/tools.yaml or 锅巴
|
> 进入哔哩哔哩网站 -- 打开F12开发者选项 -- 应用 -- 找到Cookie -- 找到SESSDATA -- 复制 -- 粘贴到plugins/rconsole-plugin/config/tools.yaml or 锅巴
|
||||||
> [图文教程【群友推荐!】](https://www.bilibili.com/read/cv12349604)
|
> [图文教程【群友推荐!】](https://www.bilibili.com/read/cv12349604)
|
||||||
|
|
||||||
## 🤺 R插件交流群
|
## 🤺 R插件交流群
|
||||||
重新开放TG交流氛围群(群内不解答任何问题,只提供交流环境)
|
马上开放
|
||||||
[点击进群](https://t.me/+ZsZMNE8OI7E3MDdl)
|
|
||||||
|
|
||||||
## 🧑🌾 进阶内容
|
## 🧑🌾 进阶内容
|
||||||
【可选】相关配置(apps/tools.js):
|
【可选】相关配置(apps/tools.js):
|
||||||
@ -96,21 +88,28 @@ sudo apt-get install ffmpeg
|
|||||||
> (非必要不更改)更改魔法在`config/tools.yaml` 或 [锅巴插件](https://gitee.com/guoba-yunzai/guoba-plugin)的配置位置:
|
> (非必要不更改)更改魔法在`config/tools.yaml` 或 [锅巴插件](https://gitee.com/guoba-yunzai/guoba-plugin)的配置位置:
|
||||||
`proxyAddr: '127.0.0.1' # 魔法地址`
|
`proxyAddr: '127.0.0.1' # 魔法地址`
|
||||||
`proxyPort: '7890' # 魔法端口`
|
`proxyPort: '7890' # 魔法端口`
|
||||||
|
|
||||||
|
## douyin_cookie问题
|
||||||
|
由于douyin的解析变化莫测,现版本需要填入自己的cookkie,具体步骤如下:
|
||||||
|
1. 打开`https://www.douyin.com/` 扫码登入自己的账号
|
||||||
|
2. F12进入控制台,或者下载一个[Cookie-Editor](https://www.crxsoso.com/webstore/detail/hlkenndednhfkekhgcdicdfddnkalmdm)
|
||||||
|
3. 如果是F12,就将以下参数填入到`tools.yaml - douyinCookie`,或者使用锅巴
|
||||||
|
> odin_tt=xxx;sessionid_ss=xxx;ttwid=xxx;passport_csrf_token=xxx;msToken=xxx;
|
||||||
|
|
||||||
|
3. 如果是`Cookie-Editor`就直接到插件复制到`tools.yaml - douyinCookie`,或者锅巴
|
||||||
|
|
||||||
## 📦 业务
|
## 📦 业务
|
||||||

|

|
||||||
|
|
||||||
## 📦 扩展业务
|
|
||||||
[点击体验R插件的补集(自定义回复、GPT Bing二合一回复)](https://gitee.com/kyrzy0416/rconsole-plugin-complementary-set)
|
|
||||||

|
|
||||||

|
|
||||||
|
|
||||||
## 📝 计划功能
|
## 📝 计划功能
|
||||||
- [ ] YouTube解析(这个可能要🕊一久)
|
- [ ] YouTube解析(这个可能要🕊一久)
|
||||||
- [x] Instagram解析
|
- [ ] Instagram解析修复
|
||||||
- [ ] 单张图片解析
|
- [ ] 单张图片解析
|
||||||
- [ ] 视频解析
|
- [ ] 视频解析
|
||||||
- [x] 哔哩哔哩总结
|
- [x] 哔哩哔哩总结
|
||||||
- [ ] 精简工具功能冗余代码
|
- [ ] xhs解析去水印
|
||||||
|
- [ ] 快手解析
|
||||||
|
- [ ] 西瓜视频解析
|
||||||
- [ ] ...
|
- [ ] ...
|
||||||
|
|
||||||
|
|
||||||
@ -143,14 +142,6 @@ sudo apt-get install ffmpeg
|
|||||||
| mitsuha | 1杯瑞幸 |
|
| mitsuha | 1杯瑞幸 |
|
||||||
| [Kr] 5s¹ | 1杯瑞幸 |
|
| [Kr] 5s¹ | 1杯瑞幸 |
|
||||||
|
|
||||||
## 👩👩👧👧 开发团队
|
|
||||||
| Nickname | Contribution |
|
|
||||||
| :----------------------------------------------------------: |--------------|
|
|
||||||
|[易曦翰](https://gitee.com/yixihan) | 后端开发 |
|
|
||||||
|[zhiyu](https://gitee.com/kyrzy0416) | 后端开发 |
|
|
||||||
|[Diviner](https://gitee.com/divinerJJ) | 前端开发 |
|
|
||||||
|[小白白](https://gitee.com/little_White01) | 后端开发 |
|
|
||||||
|
|
||||||
## 🚀 后记
|
## 🚀 后记
|
||||||
* 文件借鉴了很多插件,精简个人认为可以精简的内容。
|
* 文件借鉴了很多插件,精简个人认为可以精简的内容。
|
||||||
* 素材来源于网络,仅供交流学习使用
|
* 素材来源于网络,仅供交流学习使用
|
||||||
|
@ -93,6 +93,8 @@ export class tools extends plugin {
|
|||||||
this.biliSessData = this.toolsConfig.biliSessData;
|
this.biliSessData = this.toolsConfig.biliSessData;
|
||||||
// 加载哔哩哔哩的限制时长
|
// 加载哔哩哔哩的限制时长
|
||||||
this.biliDuration = this.toolsConfig.biliDuration;
|
this.biliDuration = this.toolsConfig.biliDuration;
|
||||||
|
// 加载抖音Cookie
|
||||||
|
this.douyinCookie = this.toolsConfig.douyinCookie;
|
||||||
// 加载gpt配置:accessToken、apiKey、模型
|
// 加载gpt配置:accessToken、apiKey、模型
|
||||||
this.openaiAccessToken = this.toolsConfig.openaiAccessToken;
|
this.openaiAccessToken = this.toolsConfig.openaiAccessToken;
|
||||||
this.openaiApiKey = this.toolsConfig.openaiApiKey;
|
this.openaiApiKey = this.toolsConfig.openaiApiKey;
|
||||||
@ -151,6 +153,11 @@ export class tools extends plugin {
|
|||||||
const douUrl = urlRex.exec(e.msg.trim())[0];
|
const douUrl = urlRex.exec(e.msg.trim())[0];
|
||||||
|
|
||||||
await this.douyinRequest(douUrl).then(async res => {
|
await this.douyinRequest(douUrl).then(async res => {
|
||||||
|
// 当前版本需要填入cookie
|
||||||
|
if (_.isEmpty(this.douyinCookie)) {
|
||||||
|
e.reply("检测到没有Cookie,无法解析抖音");
|
||||||
|
return;
|
||||||
|
}
|
||||||
const douId = /note\/(\d+)/g.exec(res)?.[1] || /video\/(\d+)/g.exec(res)?.[1];
|
const douId = /note\/(\d+)/g.exec(res)?.[1] || /video\/(\d+)/g.exec(res)?.[1];
|
||||||
// 以下是更新了很多次的抖音API历史,且用且珍惜
|
// 以下是更新了很多次的抖音API历史,且用且珍惜
|
||||||
// const url = `https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?item_ids=${ douId }`;
|
// const url = `https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?item_ids=${ douId }`;
|
||||||
@ -160,10 +167,10 @@ export class tools extends plugin {
|
|||||||
"accept-encoding": "gzip, deflate, br",
|
"accept-encoding": "gzip, deflate, br",
|
||||||
"User-Agent":
|
"User-Agent":
|
||||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
|
||||||
referer: "https://www.douyin.com/",
|
Referer: "https://www.douyin.com/",
|
||||||
cookie: "s_v_web_id=verify_leytkxgn_kvO5kOmO_SdMs_4t1o_B5ml_BUqtWM1mP6BF;",
|
cookie: this.douyinCookie,
|
||||||
};
|
};
|
||||||
const dyApi = `https://www.douyin.com/aweme/v1/web/aweme/detail/?device_platform=webapp&aid=6383&channel=channel_pc_web&aweme_id=${douId}&pc_client_type=1&version_code=190500&version_name=19.5.0&cookie_enabled=true&screen_width=1344&screen_height=756&browser_language=zh-CN&browser_platform=Win32&browser_name=Firefox&browser_version=110.0&browser_online=true&engine_name=Gecko&engine_version=109.0&os_name=Windows&os_version=10&cpu_core_num=16&device_memory=&platform=PC&webid=7158288523463362079&msToken=abL8SeUTPa9-EToD8qfC7toScSADxpg6yLh2dbNcpWHzE0bT04txM_4UwquIcRvkRb9IU8sifwgM1Kwf1Lsld81o9Irt2_yNyUbbQPSUO8EfVlZJ_78FckDFnwVBVUVK`;
|
const dyApi = `https://www.douyin.com/aweme/v1/web/aweme/detail/?device_platform=webapp&aid=6383&channel=channel_pc_web&aweme_id=${douId}&pc_client_type=1&version_code=190500&version_name=19.5.0&cookie_enabled=true&screen_width=1344&screen_height=756&browser_language=zh-CN&browser_platform=Win32&browser_name=Firefox&browser_version=118.0&browser_online=true&engine_name=Gecko&engine_version=109.0&os_name=Windows&os_version=10&cpu_core_num=16&device_memory=&platform=PC&webid=7284189800734082615&msToken=B1N9FM825TkvFbayDsDvZxM8r5suLrsfQbC93TciS0O9Iii8iJpAPd__FM2rpLUJi5xtMencSXLeNn8xmOS9q7bP0CUsrt9oVTL08YXLPRzZm0dHKLc9PGRlyEk=`;
|
||||||
// xg参数
|
// xg参数
|
||||||
const xbParam = xBogus.sign(
|
const xbParam = xBogus.sign(
|
||||||
new URLSearchParams(new URL(dyApi).search).toString(),
|
new URLSearchParams(new URL(dyApi).search).toString(),
|
||||||
@ -171,6 +178,7 @@ export class tools extends plugin {
|
|||||||
);
|
);
|
||||||
// const param = resp.data.result[0].paramsencode;
|
// const param = resp.data.result[0].paramsencode;
|
||||||
const resDyApi = `${dyApi}&X-Bogus=${xbParam}`;
|
const resDyApi = `${dyApi}&X-Bogus=${xbParam}`;
|
||||||
|
headers['Referer'] = `https://www.douyin.com/video/${douId}`
|
||||||
axios
|
axios
|
||||||
.get(resDyApi, {
|
.get(resDyApi, {
|
||||||
headers,
|
headers,
|
||||||
@ -180,6 +188,7 @@ export class tools extends plugin {
|
|||||||
e.reply("解析失败,请重试!");
|
e.reply("解析失败,请重试!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log(resp.data)
|
||||||
const item = resp.data.aweme_detail;
|
const item = resp.data.aweme_detail;
|
||||||
e.reply(`识别:抖音, ${item.desc}`);
|
e.reply(`识别:抖音, ${item.desc}`);
|
||||||
const urlTypeCode = item.aweme_type;
|
const urlTypeCode = item.aweme_type;
|
||||||
|
@ -11,3 +11,5 @@ biliDuration: 480 # 哔哩哔哩限制的最大视频时长(默认8分钟)
|
|||||||
openaiAccessToken: '' # 通过获取:https://chat.openai.com/api/auth/session
|
openaiAccessToken: '' # 通过获取:https://chat.openai.com/api/auth/session
|
||||||
openaiApiKey: '' # sk...
|
openaiApiKey: '' # sk...
|
||||||
openaiModel: 'gpt-3.5-turbo' # 目前gpt-3.5-turbo效果比较好,廉价,适合群友
|
openaiModel: 'gpt-3.5-turbo' # 目前gpt-3.5-turbo效果比较好,廉价,适合群友
|
||||||
|
|
||||||
|
douyinCookie: '' # douyin's cookie, 格式:odin_tt=xxx;sessionid_ss=xxx;ttwid=xxx;passport_csrf_token=xxx;msToken=xxx;
|
@ -1,5 +1,5 @@
|
|||||||
- {
|
- {
|
||||||
version: 1.1.0-rc1,
|
version: 1.1.1,
|
||||||
data:
|
data:
|
||||||
[
|
[
|
||||||
新增<span class="cmd">竹白百科</span>功能,
|
新增<span class="cmd">竹白百科</span>功能,
|
||||||
|
@ -108,6 +108,17 @@ export function supportGuoba() {
|
|||||||
placeholder: "请输入OpenAI的AccessToken(ey.....)",
|
placeholder: "请输入OpenAI的AccessToken(ey.....)",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: "tools.douyinCookie",
|
||||||
|
label: "抖音的Cookie",
|
||||||
|
bottomHelpMessage:
|
||||||
|
"登陆https://www.douyin.com/ - F12 - 自己替换一下odin_tt=xxx;sessionid_ss=xxx;ttwid=xxx;passport_csrf_token=xxx;msToken=xxx;",
|
||||||
|
component: "Input",
|
||||||
|
required: false,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: "请输入抖音的Cookie",
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
getConfigData() {
|
getConfigData() {
|
||||||
const toolsData = {
|
const toolsData = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user