Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add danmaku support for bilibli video playback #58

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

dyphire
Copy link
Collaborator

@dyphire dyphire commented Nov 12, 2024

另见 #57

@dyphire dyphire force-pushed the bilibili branch 7 times, most recently from 719193f to 9f094d4 Compare November 12, 2024 04:50
@Tony15246
Copy link
Owner

大佬觉得这个fallback有必要添加吗?或者我可以先pr,后面再优化和添加fallback。

@dyphire
Copy link
Collaborator Author

dyphire commented Nov 12, 2024

大佬觉得这个fallback有必要添加吗?或者我可以先pr,后面再优化和添加fallback。

我在调试 fallback,本地似乎出了点问题

@Tony15246
Copy link
Owner

我在调试 fallback,本地似乎出了点问题

OK

@dyphire dyphire force-pushed the bilibili branch 2 times, most recently from 235f17d to 394f7c4 Compare November 12, 2024 05:16
@dyphire
Copy link
Collaborator Author

dyphire commented Nov 12, 2024

应该可以了

Copy link
Owner

@Tony15246 Tony15246 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

end

if cid == nil then
cid = mp.get_opt('cid')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里我觉得还可以再加一个fallback,参考下面这个实现。不过这个实现的正则我觉得写的有点不太好,我个人觉得用这个正则匹配更好一点bilivideo%.c[nom]+.*/(%d+)-%d+-%d+%.%.*%?

https://github.com/shmilee/config-mpv/blob/767d35069cbaa317ed176062b07372a9787e63e2/scripts/danmuku.lua#L354-L363

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

个人觉得可以加一段下面这样的,作为mp.get_opt('cid')拿不到时候的fallback

local pat = "bilivideo%.c[nom]+.*/(%d+)-%d+-%d+%.%.*%?"
local path = mp.get_property("path")
  if path:find(pat) then
        cid = path:match(pat)
  end
end

@Tony15246 Tony15246 merged commit de795ca into Tony15246:main Nov 12, 2024
dyphire pushed a commit to dyphire/uosc_danmaku that referenced this pull request Jan 25, 2025
feat: add danmaku support for bilibli video playback
dyphire pushed a commit to dyphire/uosc_danmaku that referenced this pull request Jan 25, 2025
feat: add danmaku support for bilibli video playback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants