logo头像

技术引领生活!

哔哩哔哩缓存视频导出教程

有时候趁着那啥搜到的资源,结果因为侵权嘛.被删了…还好有缓存,怎么导出呢?请往下看

  1. 将手机连接到电脑,打开 XXXX/Android/data/tv.danmaku.bili/download 文件夹找到要导出的视频
    如下图
    哔哩哔哩视频缓存路径

  2. 运行本大神写的小脚本(需要安装ffmpeg)

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    # /bin/bash

    import os
    import json

    def listDir(path):
    files = os.listdir(path)
    for file in files:
    jsName = os.path.join(path, file, "entry.json")

    audioName = os.path.join(path, file, "16", "audio.m4s")
    videoName = os.path.join(path, file, "16", "video.m4s")

    try:
    with open(jsName, "r") as f:
    data = f.read()
    try:
    info = json.loads(data)
    title = info['page_data']['part']
    # ffmpeg -i video.mp4 -i audio.wav -c:v copy -c:a aac -strict experimental output.mp4
    os.popen(
    'ffmpeg -i %s -i %s -c:v copy -c:a aac -strict experimental "%s.mp4"' % (audioName, videoName, title))
    print(audioName, title)
    except:
    print("#################", jsName)
    pass
    except:
    print(jsName)


    if __name__ == "__main__":
    listDir(".")
  3. 硬是凑够三步….

支付宝打赏 微信打赏

您的支持是我前行的动力!