使用yt-dlp和mpv浏览B站直播
2026-03-18 16:17:24

用了yt-dlpmpv,摆烂 + 快乐摸鱼!

bili-live

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
if [ $# == 1 ]
then
m --profile=bili-live \
https://live.bilibili.com/"$1"
elif [ $# == 3 ] && [ "$2" == '-r' ]
then
time=$(date "+%m%d%H%M%S")
filename="/home/xwx/Media/Live/${3}-${time}.flv"
echo "Record in ~/Media/Live/"
m --profile=bili-live \
--stream-record="${filename}" \
https://live.bilibili.com/"$1"
elif [ $# > 2 ] && [ "$2" == '-a' ]
then
m --profile=bili-live \
https://live.bilibili.com/"$1" \
"${*:3}"
else
echo "bili-live:Wrong Arg!"
fi

m

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

cmd='mpv.exe'
opt=''

params=""
urls=""

for arg in "$@"; do
if [[ $arg == http* ]]; then
urls+=" $arg"
elif [[ $arg == *=* ]]; then
if [[ $arg != --* ]]; then
arg="--$arg"
fi
params+=" $arg"
else
echo "Unknown Arg: $arg" >&2
exit 1
fi
done

echo "exec $cmd$params$urls" | bash

例子
bili-live 593 # For Just Live
bili-live r 196 # For 自溜

关注泠鸢yousa喵,关注泠鸢yousa谢谢喵!

上一页
2026-03-18 16:17:24
下一页