mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-09-26 22:49:14 +08:00
Merge branch 'preview-fixes' of https://github.com/the1812/Bilibili-Evolved into preview-fixes
This commit is contained in:
commit
95ee56b53a
@ -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 {
|
||||
|
@ -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: {
|
||||
|
@ -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,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user