feat: 番剧搜索

This commit is contained in:
lanyeeee
2025-08-10 06:13:29 +08:00
parent ae57231577
commit 44f9171313
4 changed files with 364 additions and 10 deletions
+30
View File
@@ -31,6 +31,36 @@ export function extractBvid(url: string): string | undefined {
}
}
export function extractEpId(url: string): number | undefined {
const parsedUrl = new URL(url)
const pathname = parsedUrl.pathname
const segments = pathname.split('/')
for (const segment of segments) {
if (segment.toLowerCase().startsWith('ep')) {
const epIdString = segment.substring(2)
const epId = parseInt(epIdString, 10)
if (!isNaN(epId)) {
return epId
}
}
}
}
export function extractSeasonId(url: string): number | undefined {
const parsedUrl = new URL(url)
const pathname = parsedUrl.pathname
const segments = pathname.split('/')
for (const segment of segments) {
if (segment.toLowerCase().startsWith('ss')) {
const seasonIdString = segment.substring(2)
const seasonId = parseInt(seasonIdString, 10)
if (!isNaN(seasonId)) {
return seasonId
}
}
}
}
export function useEpisodeDropdown(onCheck: () => void, onUncheck: () => void, onSelectAll: () => void) {
const dropdownX = ref<number>(0)
const dropdownY = ref<number>(0)