From cc0fa67dea3c971557c3a5820fce70d7d7ec2200 Mon Sep 17 00:00:00 2001 From: aaa1115910 Date: Tue, 24 Dec 2024 20:21:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20mcdn=20=E6=8E=92=E9=99=A4?= =?UTF-8?q?=E6=97=A0=E6=95=88=EF=BC=88App=E6=8E=A5=E5=8F=A3=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dev/aaa1115910/bv/viewmodel/VideoPlayerV3ViewModel.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/dev/aaa1115910/bv/viewmodel/VideoPlayerV3ViewModel.kt b/app/src/main/kotlin/dev/aaa1115910/bv/viewmodel/VideoPlayerV3ViewModel.kt index 29d236af..605b9ed3 100644 --- a/app/src/main/kotlin/dev/aaa1115910/bv/viewmodel/VideoPlayerV3ViewModel.kt +++ b/app/src/main/kotlin/dev/aaa1115910/bv/viewmodel/VideoPlayerV3ViewModel.kt @@ -547,7 +547,10 @@ class VideoPlayerV3ViewModel( val filteredUrls = urls .filter { !it.contains(".mcdn.bilivideo.") } .filter { !it.contains(".szbdyd.com") } - .filter { !Regex("""^https?://\d{1,3}.\d{1,3}""").matches(it) } + .filter { + !Regex("^(https?://)?(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?)(/[a-zA-Z0-9_./-]*)?(\\?.*)?$") + .matches(it) + } if (filteredUrls.isEmpty()) { logger.fInfo { "doesn't find any official cdn url, select the first url" } return urls.first()