feat: 使用临时方案解决 dy 动图无法解析问题

This commit is contained in:
zhiyu1998 2024-10-28 17:17:27 +08:00
parent c9c38ff10a
commit 58ceb8f5dd
2 changed files with 12 additions and 0 deletions

View File

@ -355,6 +355,11 @@ export class tools extends plugin {
ttwid = ttwidValue; ttwid = ttwidValue;
douUrl = location douUrl = location
} }
// TODO 如果有新的好解决方案可以删除如果遇到https://www.iesdouyin.com/share/slides这类动图暂时交付给其他API解析
if (douUrl.includes("share/slides")) {
this.general(e);
return;
}
// 获取 ID // 获取 ID
const douId = /note\/(\d+)/g.exec(douUrl)?.[1] || const douId = /note\/(\d+)/g.exec(douUrl)?.[1] ||
/video\/(\d+)/g.exec(douUrl)?.[1] || /video\/(\d+)/g.exec(douUrl)?.[1] ||

View File

@ -113,6 +113,12 @@ class GeneralLinkAdapter {
return { name: "即刻", reqLink }; return { name: "即刻", reqLink };
} }
async douyinBackup(link) {
const msg = /(http:\/\/|https:\/\/)v.douyin.com\/[A-Za-z\d._?%&+\-=\/#]*/.exec(link)?.[0];
const reqLink = this.createReqLink(GENERAL_REQ_LINK, msg);
return { name: "抖音动图", reqLink };
}
/** /**
* 初始化通用适配器 * 初始化通用适配器
* @param link 通用链接 * @param link 通用链接
@ -128,6 +134,7 @@ class GeneralLinkAdapter {
[/tieba.baidu.com/, this.tieba.bind(this)], [/tieba.baidu.com/, this.tieba.bind(this)],
[/xsj.qq.com/, this.qqSmallWorld.bind(this)], [/xsj.qq.com/, this.qqSmallWorld.bind(this)],
[/m.okjike.com/, this.jike.bind(this)], [/m.okjike.com/, this.jike.bind(this)],
[/v.douyin.com/, this.douyinBackup.bind(this)],
]); ]);
for (let [regex, handler] of handlers) { for (let [regex, handler] of handlers) {