B站缓存剧集散乱,用python移动,重命名文件

来自之前cnblog的博客
源地址:https://www.cnblogs.com/This-is-Y/p/12423345.html
使用python的shutil库
移动
shutil.move(要移动的文件位置,目标位置)
复制
shutil.copy(要移动的文件位置,目标位置)
如shutil.move(r’E:\41942769\test\111.txt’, r’E:\41942769\test_2\222.txt’)
(这里加在字符串前面的的r是为了防止 ‘' 转义)
这里是发现b站下载的视频如果有很多集,在文件夹中是如此显示的


每个视频文件在最后都是0.blv的格式,其他的一些json文件,xml文件是视频信息和弹幕信息。
这里用了两个小脚本把视频都放在一起,并且把视频文件命名位在B站中看到的名字
移动
重命名
这边在分集下的文件夹中的entry.json文件中找到视频名字,用json稍微操作一下就可以得到视频名字。
最后结果是这样的

评论
评论插件加载失败
正在加载评论插件