赞
踩
搜索m4s即可,在Android/data/tv.danmaku.bili/download中,每组视频放在一串数字为名字的文件夹中
本人host是ubuntu18.04
需要安装ffmpeg(大神可替换其他工具,不过大神应该不需要我的脚本~)
参考文章:https://www.bilibili.com/read/mobile/4909720
make_mp4.sh
#!/bin/bash out_dir=$1 dir_local=`pwd` out_dir=$dir_local/$out_dir find -name "video.m4s" > tmp.log lines=`sed -n '$=' tmp.log` count=0 while [ 1 ] do count=$((count + 1)) if [ $count -gt $lines ];then break fi video_file=`sed -n ${count}p tmp.log` tmp=${video_file#./} tmp="./${tmp%%/*}/entry.json" echo "run: python3 get_part_name.py $tmp" name=`python3 get_part_name.py $tmp` name=${name// /_} name=${name//:/_} name=${name_} dir=${video_file%/*} echo "**********************************" echo "$video_file" echo "dir:$dir, file:${out_dir}/${name}.mp4" echo "**********************************" cd $dir rm *.mp4 ffmpeg -i video.m4s -i audio.m4s -c:v copy -strict experimental test.mp4 mv test.mp4 ${out_dir}/${name}.mp4 cd - done
get_part_name.py
import sys
import os
import json
if __name__ == '__main__':
filename = sys.argv[1]
index = "page_data"
config = json.loads(open(filename, 'rb').read().decode('utf-8'))
if index in config:
if "part" in config[index]:
print(config[index]["part"])
else:
print("error")
sys.exit(-1)
sys.exit(0)
两个脚本同时放在一串数字为名字的文件夹中,如图:
./make_mp4.sh out
out中即可得到想要的视频,如图:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。