Merge branch 'preview-fixes' of https://github.com/the1812/Bilibili-Evolved into preview-fixes

This commit is contained in:
the1812 2025-08-29 08:26:33 +08:00
commit 95ee56b53a
3 changed files with 9 additions and 5 deletions

View File

@ -3,8 +3,12 @@ import { getCsrf, getUID } from '@/core/utils'
// 获取当前直播间号
export function getLiveRoomId(): string {
const matched = location.href.match(/live.bilibili.com\/(blanc\/)?(\d+)/)
return matched ? matched[2] : ''
let matched = location.href.match(/live.bilibili.com\/(\d+)/)
if (matched) {
return matched[1]
}
matched = location.href.match(/live.bilibili.com\/blanc\/(\d+)/)
return matched ? matched[1] : ''
}
export function validateRoomId(value: string): boolean {

View File

@ -23,8 +23,7 @@ export default Vue.extend({
data() {
return {
downloading: false,
midRegex: /mid=(\d+)/,
roomIdRegex: /^https:\/\/live\.bilibili\.com\/(\d+)(?:\?.*)?$/,
roomIdRegex: /^https:\/\/live\.bilibili\.com\/(?:blanc\/)?(\d+)(?:\?\.*?)?$/,
}
},
methods: {

View File

@ -1,4 +1,5 @@
import { defineComponentMetadata } from '@/components/define'
import { liveUrls } from '@/core/utils/urls'
export const component = defineComponentMetadata({
name: 'downloadEmoticons',
@ -12,5 +13,5 @@ export const component = defineComponentMetadata({
widget: {
component: () => import('./Widget.vue').then(m => m.default),
},
urlInclude: [/^https:\/\/live\.bilibili\.com\/(\d+)/],
urlInclude: liveUrls,
})