Skip to content

feat(bilibili-parse): 增加BV码识别方式#1205

Closed
Lianzy-Baimiao wants to merge 1 commit into
FloatTech:masterfrom
Lianzy-Baimiao:master
Closed

feat(bilibili-parse): 增加BV码识别方式#1205
Lianzy-Baimiao wants to merge 1 commit into
FloatTech:masterfrom
Lianzy-Baimiao:master

Conversation

@Lianzy-Baimiao

Copy link
Copy Markdown

增加 BV码 识别的方式

handleLive(ctx)
}
})
en.OnRegex(`^([BV][A-Za-z0-9]+)`).SetBlock(true).Limit(limit.LimitByGroup).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
en.OnRegex(`^([BV][A-Za-z0-9]+)`).SetBlock(true).Limit(limit.LimitByGroup).
en.OnRegex(`(BV[A-Za-z0-9]{10,})`).SetBlock(true).Limit(limit.LimitByGroup).

})
en.OnRegex(`^([BV][A-Za-z0-9]+)`).SetBlock(true).Limit(limit.LimitByGroup).
Handle(func(ctx *zero.Ctx) {
u := ctx.State["regex_matched"].([]string)[0]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

直接用ctx.State["regex_matched"].([]string)[1]拿到匹配的BV号,一次拼接为完整链接。

@fumiama

fumiama commented Sep 26, 2025

Copy link
Copy Markdown
Member

close due to repo package change

@fumiama fumiama closed this Sep 26, 2025
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