douban源和tmdb源修复某些剧名不一致导致过滤的问题以及其他小修小补 (#88)
* 优化根据imdbid获取豆瓣信息 * douban源过滤一些不是电影/电视剧的类型 * douban源和tmdb源修复某些剧名不一致导致过滤的问题
This commit is contained in:
1 parent
61dc1b05d3
commit
9d72069918
5 files changed
+17
-8
No files matched your search
@@ -258,7 +258,7 @@ LogVar 弹幕 API 服务器
|
||||
> cf部署可能不稳定,推荐用vercel/netlify部署。
|
||||
|
||||
## API食用指南
|
||||
支持 forward/senplayer/hills/小幻/yamby/eplayerx/afusekt 等支持弹幕API的播放器。
|
||||
支持 forward/senplayer/hills/小幻/yamby/eplayerx/afusekt/uz影视/dscloud 等支持弹幕API的播放器。
|
||||
|
||||
以`senplayer`为例:
|
||||
1. 获取到部署之后的API地址,如 `http://192.168.1.7:9321/87654321` ,其中`87654321`是默认token,如果有自定义环境变量TOKEN,请替换成相应的token
|
||||
@@ -315,7 +315,7 @@ API 支持返回 Bilibili 标准 XML 格式的弹幕数据,通过查询参数
|
||||
| 变量名称 | 描述 |
|
||||
| ----------- | ----------- |
|
||||
| TOKEN | 【可选】自定义用户token,不填默认为`87654321` |
|
||||
| OTHER_SERVER | 【可选】兜底第三方弹幕服务器,不填默认为`https://api.danmu.icu` |
|
||||
| OTHER_SERVER | 【可选】兜底第三方弹幕服务器,不填默认为`https://api.danmu.icu`,其他可选:`https://fc.lyz05.cn`,`https://dmku.hls.one`,`https://se.678.ooo`,`https://danmu.56uxi.com`,`https://dm.lxlad.com` |
|
||||
| VOD_SERVERS | 【可选】VOD服务器列表,支持多个服务器并发查询,格式:`名称@URL,名称@URL,...`,示例:`金蝉@https://zy.jinchancaiji.com,789@https://www.caiji.cyou,听风@https://gctf.tfdh.top`,不填默认为`金蝉@https://zy.jinchancaiji.com,789@https://www.caiji.cyou,听风@https://gctf.tfdh.top` |
|
||||
| VOD_RETURN_MODE | 【可选】VOD返回模式,可选值:`all`(返回所有站点结果)、`fastest`(只返回最快的站点结果),默认为`fastest`。当配置多个VOD站点时,`all`模式会返回所有站点的结果(结果较多),`fastest`模式只返回首先响应成功的站点结果(结果较少,避免重复) |
|
||||
| VOD_REQUEST_TIMEOUT | 【可选】VOD服务器单个请求超时时间(毫秒),防止慢速或失效的采集站阻塞搜索,默认为`10000`(10秒),建议值:`5000-15000`。由于`fastest`模式只返回最快响应的站点,可以设置较大的超时时间给慢速站点更多机会 |
|
||||
@@ -479,6 +479,7 @@ danmu_api/
|
||||
- 推荐vercel/netlify部署,cloudflare/edgeone/claw不稳定,当然最稳定还是自己本地docker部署最佳。
|
||||
- /api/v2/comment接口默认限流:1分钟内同一IP只能请求3次,可通过环境变量`RATE_LIMIT_MAX_REQUESTS`调整(设置为0表示不限流)。
|
||||
- TMDB源请求逻辑:search tmdb -> tmdbId -> imdbId -> doubanId -> playUrl;优点:emby通过tmdb刮削,标题通过tmdb搜索,返回的信息可能更加匹配;缺点:链条过长,请求时长5-10s左右,中间一环数据有缺失,就没有返回结果。
|
||||
- TMDB源在SOURCE_ORDER添加tmdb的同时,需要添加TMDB_API_KEY环境变量
|
||||
|
||||
### 关联项目
|
||||
[喂饭教程1:danmu_api vercel 自动同步部署方案 - 永远保持最新版本!实时同步原作者更新](https://github.com/xiaoyao20084321/log-var-danmu-deployment-guide)
|
||||
@@ -487,6 +488,8 @@ danmu_api/
|
||||
|
||||
[喂饭教程3:使用Netlify反向代理巴哈姆特api,实现danmu_api项目国内直连获取巴哈姆特弹幕](https://github.com/wan0ge/bahamut-api-proxy)
|
||||
|
||||
[喂饭教程4:使用Vercel搭建万能反向代理,部署后请绑定自定义域名使用](https://github.com/souying/vercel-api-proxy)
|
||||
|
||||
### 部署完成后在播放器填写后弹幕未生效自主排查步骤
|
||||
以API示例 `http://192.168.1.7:9321/87654321` 为例
|
||||
1. 首先确认你的api部署成功 访问 `http://192.168.1.7:9321/87654321` 有json输出
|
||||
|
||||
@@ -11,7 +11,7 @@ export const Globals = {
|
||||
accessedEnvVars: {},
|
||||
|
||||
// 静态常量
|
||||
VERSION: '1.7.0',
|
||||
VERSION: '1.7.1',
|
||||
MAX_LOGS: 500, // 日志存储,最多保存 500 行
|
||||
MAX_ANIMES: 100,
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ export default class DoubanSource extends BaseSource {
|
||||
if (anime?.layout !== "subject") return;
|
||||
const doubanId = anime.target_id;
|
||||
let animeType = anime?.type_name;
|
||||
if (animeType !== "电影" && animeType !== "电视剧") return;
|
||||
log("info", "doubanId: ", doubanId, anime?.target?.title, animeType);
|
||||
|
||||
// 获取平台详情页面url
|
||||
@@ -111,7 +112,7 @@ export default class DoubanSource extends BaseSource {
|
||||
if (cid) {
|
||||
tmpAnimes[0].provider = "tencent";
|
||||
tmpAnimes[0].mediaId = cid;
|
||||
await this.tencentSource.handleAnimes(tmpAnimes, queryTitle, doubanAnimes)
|
||||
await this.tencentSource.handleAnimes(tmpAnimes, response.data?.title, doubanAnimes)
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -120,7 +121,7 @@ export default class DoubanSource extends BaseSource {
|
||||
if (tvid) {
|
||||
tmpAnimes[0].provider = "iqiyi";
|
||||
tmpAnimes[0].mediaId = anime?.type_name === '电影' ? `movie_${tvid}` : tvid;
|
||||
await this.iqiyiSource.handleAnimes(tmpAnimes, queryTitle, doubanAnimes)
|
||||
await this.iqiyiSource.handleAnimes(tmpAnimes, response.data?.title, doubanAnimes)
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -129,7 +130,7 @@ export default class DoubanSource extends BaseSource {
|
||||
if (showId) {
|
||||
tmpAnimes[0].provider = "youku";
|
||||
tmpAnimes[0].mediaId = showId;
|
||||
await this.youkuSource.handleAnimes(tmpAnimes, queryTitle, doubanAnimes)
|
||||
await this.youkuSource.handleAnimes(tmpAnimes, response.data?.title, doubanAnimes)
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -138,7 +139,7 @@ export default class DoubanSource extends BaseSource {
|
||||
if (seasonId) {
|
||||
tmpAnimes[0].provider = "bilibili";
|
||||
tmpAnimes[0].mediaId = `ss${seasonId}`;
|
||||
await this.bilibiliSource.handleAnimes(tmpAnimes, queryTitle, doubanAnimes)
|
||||
await this.bilibiliSource.handleAnimes(tmpAnimes, response.data?.title, doubanAnimes)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,9 @@ export default class TmdbSource extends BaseSource {
|
||||
}
|
||||
|
||||
async _getDoubanInfo(finalImdbId, mediaType, doubanIds) {
|
||||
if (!finalImdbId) return;
|
||||
const doubanInfo = await getDoubanInfoByImdbId(finalImdbId);
|
||||
if (!doubanInfo || !doubanInfo?.data) return;
|
||||
const url = doubanInfo?.data?.id; // "https://api.douban.com/movie/1299131"
|
||||
if (url) {
|
||||
const parts = url.split("/"); // ["https:", "", "api.douban.com", "movie", "1299131"]
|
||||
|
||||
@@ -186,7 +186,10 @@ export function addAnime(anime) {
|
||||
}
|
||||
}
|
||||
|
||||
log("info", `animes: ${JSON.stringify(globals.animes)}`);
|
||||
log("info", `animes: ${JSON.stringify(
|
||||
globals.animes,
|
||||
(key, value) => key === 'links' ? value.length : value
|
||||
)}`);
|
||||
|
||||
return true;
|
||||
} catch (error) {
|
||||
|
||||
Reference in new issue
Block a user