diff --git a/src/api/play-url.test.ts b/src/api/play-url.test.ts
index 68f2c51..df36ddc 100644
--- a/src/api/play-url.test.ts
+++ b/src/api/play-url.test.ts
@@ -2,7 +2,7 @@ import { test } from 'vitest'
import request from './fetcher'
import { PlayUrlResponseSchema } from './play-url.schema'
-
+// import fs from 'node:fs'
test('get-play-url', async () => {
const res = await request(
'/x/player/wbi/playurl?bvid=BV1Av421r7Ur&cid=1454646853&type=mp4&qn=64&fnval=1&platform=pc&high_quality=1',
@@ -23,3 +23,15 @@ test('get-play-url-html5', async () => {
)
PlayUrlResponseSchema.parse(res)
})
+
+// test('aaa', async () => {
+// const qn = [32, 64, 74, 80, 112, 116]
+// const list = {}
+// for (const q of qn) {
+// const res = await request(
+// `/x/player/wbi/playurl?bvid=BV1HH4y1h7eh&cid=1432196942&qn=${q}&fnval=16&platform=pc&high_quality=1`,
+// )
+// list[q] = res
+// }
+// fs.writeFileSync('listaaa3.json', JSON.stringify(list, null, 2))
+// })
diff --git a/src/components/CommentList.tsx b/src/components/CommentList.tsx
index 3a11159..f931afd 100644
--- a/src/components/CommentList.tsx
+++ b/src/components/CommentList.tsx
@@ -1,5 +1,6 @@
import { Icon, Skeleton, Text } from '@rneui/themed'
import { FlashList } from '@shopify/flash-list'
+import clsx from 'clsx'
import React from 'react'
import { TouchableOpacity, View } from 'react-native'
@@ -8,7 +9,6 @@ import { colors } from '@/constants/colors.tw'
import { type CommentItemType, useComments } from '../api/comments'
import { Comment } from './Comment'
import ReplyList from './ReplyList'
-import clsx from 'clsx'
function Loading() {
return (
@@ -72,7 +72,11 @@ export default function CommentList(
color={tw(colors.gray6.text).color}
/>
- {allCount ? allCount + '条评论' : '暂无评论'}
+ {allCount
+ ? allCount + '条评论'
+ : isLoading
+ ? '加载中'
+ : '暂无评论'}
diff --git a/src/routes/About/Statement.tsx b/src/routes/About/Statement.tsx
index af2b723..7c73388 100644
--- a/src/routes/About/Statement.tsx
+++ b/src/routes/About/Statement.tsx
@@ -44,10 +44,12 @@ function Statement() {
- 感谢你使用这款应用 ❤
+ 感谢你使用这款应用(MiniBili) ❤
- 本应用完全开源并且所有数据均为B站官网公开,不涉及任何个人隐私数据,仅供学习交流!
+ 本应用完全开源并且所有数据均为B站官网公开,不涉及任何个人隐私数据,
+ *仅供*
+ 个人使用及学习交流!
有问题欢迎使用意见反馈或者在
@@ -61,7 +63,7 @@ function Statement() {
中提出 😀
- ⚠️ 切勿频繁刷新数据!🙏
+ ⚠️ 切勿频繁刷新数据!🙏
)
- const search = new URLSearchParams()
- const playUrl = 'https://www.bilibili.com/blackboard/html5mobileplayer.html'
- // const playUrl = 'https://www.bilibili.com/blackboard/webplayer/mbplayer.html'
- Object.entries({
- bvid: route.params.bvid,
- cid,
- // quality: isWifi ? 64 : 32,
- portraitFullScreen: true,
- // highQuality: isWifi ? 1 : 0,
- page: props.currentPage,
- autoplay: 1, // isWifi ? 0 : 1,
- hasMuteButton: true,
- }).forEach(([k, v]) => {
- if (v !== undefined) {
- search.append(k, v + '')
+ const playPageUrl = React.useMemo(() => {
+ if (!videoUrl || !loadPlayer) {
+ return
}
- })
- const uri = `${playUrl}?${search}#${encodeURIComponent(videoUrl ?? '')}`
- const player =
- loadPlayer && cid ? (
- {
- loadingErrorRef.current = false
- }}
- onError={() => {
- showToast('当前视频加载失败/(ㄒoㄒ)/~~')
- loadingErrorRef.current = true
- }}
- onShouldStartLoadWithRequest={request => {
- // Only allow navigating within this website
- if (request.url.endsWith('/log-reporter.js')) {
- return false
- }
- if (request.url.startsWith('http') && !request.url.includes('.apk')) {
- return true
- }
+ const search = new URLSearchParams()
+ Object.entries({
+ bvid: videoInfo.bvid,
+ cid,
+ // quality: isWifi ? 64 : 32,
+ portraitFullScreen: true,
+ // highQuality: isWifi ? 1 : 0,
+ page: props.currentPage,
+ autoplay: 1, // isWifi ? 0 : 1,
+ hasMuteButton: true,
+ }).forEach(([k, v]) => {
+ if (v !== undefined) {
+ search.append(k, v + '')
+ }
+ })
+ return `${PlayUrl}?${search}#${encodeURIComponent(videoUrl)}`
+ }, [videoUrl, loadPlayer, videoInfo.bvid, props.currentPage])
+
+ const player = playPageUrl ? (
+ {
+ loadingErrorRef.current = false
+ }}
+ onError={() => {
+ showToast('当前视频加载失败/(ㄒoㄒ)/~~')
+ loadingErrorRef.current = true
+ }}
+ onShouldStartLoadWithRequest={request => {
+ // Only allow navigating within this website
+ if (request.url.endsWith('/log-reporter.js')) {
return false
- }}
- />
- ) : (
- {
- setLoadPlayer(true)
- }}
- className="flex-1">
- {videoInfo?.cover ? (
-
-
-
- {videoInfo?.duration ? (
-
- {parseDuration(videoInfo?.duration)}
-
- ) : null}
- {isWifi ? null : (
-
- 播放将消耗流量
-
+ }
+ if (request.url.startsWith('http') && !request.url.includes('.apk')) {
+ return true
+ }
+ return false
+ }}
+ />
+ ) : (
+ {
+ setLoadPlayer(true)
+ }}
+ className="flex-1">
+ {videoInfo?.cover ? (
+
+
+
+ {videoInfo?.duration ? (
+
+ {parseDuration(videoInfo?.duration)}
+
+ ) : null}
+ {isWifi ? null : (
+
+ 播放将消耗流量
+
+ )}
+
+
+
+
-
- ) : null}
-
- )
+ checkedColor={tw(colors.secondary.text).color}
+ uncheckedColor={'white'}
+ size={18}
+ containerStyle={tw('bg-transparent p-0 m-0')}
+ onPress={() => {
+ setHighQuality(!highQuality)
+ }}
+ />
+
+
+ ) : null}
+
+ )
return (
{
@@ -137,7 +137,7 @@ function __$hack() {
if (evt.target.matches('.mplayer-right *')) {
return
}
- const video = document.querySelector('video')
+ const video = document.querySelector('video[src]')
if (!video) {
return
}
diff --git a/src/routes/VideoList/Test.tsx b/src/routes/VideoList/Test.tsx
index 4f7b4c3..3675e77 100644
--- a/src/routes/VideoList/Test.tsx
+++ b/src/routes/VideoList/Test.tsx
@@ -24,7 +24,7 @@ export default function Test() {
return true
}
}
- const [current, setCurrent] = React.useState(0)
+ const [_current, setCurrent] = React.useState(0)
return (