Skip to content

Commit cc0fa67

Browse files
committed
修复 mcdn 排除无效(App接口)
1 parent 58d9bfe commit cc0fa67

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/main/kotlin/dev/aaa1115910/bv/viewmodel/VideoPlayerV3ViewModel.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,10 @@ class VideoPlayerV3ViewModel(
547547
val filteredUrls = urls
548548
.filter { !it.contains(".mcdn.bilivideo.") }
549549
.filter { !it.contains(".szbdyd.com") }
550-
.filter { !Regex("""^https?://\d{1,3}.\d{1,3}""").matches(it) }
550+
.filter {
551+
!Regex("^(https?://)?(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?)(/[a-zA-Z0-9_./-]*)?(\\?.*)?$")
552+
.matches(it)
553+
}
551554
if (filteredUrls.isEmpty()) {
552555
logger.fInfo { "doesn't find any official cdn url, select the first url" }
553556
return urls.first()

0 commit comments

Comments
 (0)