feat: 适配 FongMi影视 原生弹幕接口#296
Open
piaoyizy wants to merge 2 commits intohuangxd-:mainfrom
Open
Conversation
👷 Deploy request for danmuapi pending review.Visit the deploys page to approve it
|
|
@piaoyizy is attempting to deploy a commit to the huangxd's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
danmu_api/apis/clients/fongmi-api.js,作为 FongMi 原生弹幕请求的专用适配层worker中暴露/api/v2/fongmi/danmaku和/danmaku两个入口/danmaku/api/v2/fongmi/danmaku这类嵌套短路径请求背景
FongMi 在这个提交中新增了可配置的弹幕接口能力:
ddea7bf713065294c98522d566cdc334e2d0b889
这次更新允许源作者通过
VodConfig.danmaku配置自定义弹幕接口地址。本 PR 的目的,就是让 LogVar 的弹幕 API 能直接适配这套新接口协议,让 FongMi 可以原生请求弹幕候选,而不再依赖之前的外挂注入方式。
具体改动
danmu_api/apis/clients/fongmi-api.jsGET/POST参数:name、episodeS01E01、01x、中文期集、独立数字等场景danmu_api/worker.js/api/v2/fongmi/danmaku/danmaku/danmaku纳入 token / 路径规范化流程/danmaku/api/v2/fongmi/danmaku这类客户端重复拼接路径的情况danmu_api/apis/dandan-api.jsfilterSameEpisodeTitlegetBangumiDataForMatch接口使用方式
合并后,FongMi 可使用以下两种地址:
完整接口地址
https://your-host/{token}/api/v2/fongmi/danmaku?name={name}&episode={episode}短路径地址
https://your-host/{token}/danmakuhttps://your-host/{token}/danmaku/api/v2/fongmi/danmaku?name={name}&episode={episode}其中:
{token}为当前部署配置的访问 token{name}为 FongMi 传入的剧名{episode}为 FongMi 传入的集名验证
node --check danmu_api/apis/clients/fongmi-api.jsnode --check danmu_api/apis/dandan-api.jsnode --check danmu_api/worker.js